Compilation Prevention AssemblyFromSource for generating temp files with double file name

My WCF application uses runtime compiled code to calculate some report values. I am using CSharpCodeProvider.CompileAssemblyFromSource to compile the code. If a client (Silverlight application) requests a report when calculating another report, CSharpCodeProvider.CompileAssemblyFromSource creates temporary files with a duplicate name, which leads to an IOException ("File C: \ Windows \ TEMP \ uviewdyd.out" already exists ").

Does anyone know how to prevent this?

+5
source share
1 answer

I do not think so. It seems that all three options (file, DOM and source) create temporary files ( source ).
It seems that the best way uses different time paths for each compilation. See fooobar.com/questions/1005203 / ... :

CSharpCodeProvider prov = new CSharpCodeProvider(); CompilerParameters parms = new CompilerParameters(); parms.TempFiles = new TempFileCollection(tempdir); 
0
source

All Articles