C# CompilerParameters.OutputAssembly causes application to restart

158 views Asked by At

I am developing an ASP.Net C# application, in which users may compile piece of code on the fly. I'm using CSharpCodeProvider in this case.

The problem that I just encountered, was that somehow the CompilerParameter.OutputAssembly causes the application to restart (I checked that Application_Start() is called after compilation). Once I put it on comment, the compilation works like charm with no restarting occurs.

I'm wondering if this case is true, or if I'm missing a concept somewhere. What I understood from CompilerParameter.OutputAssembly is that it makes the assembly to be outputted into a specified file. Is it normal for the application to restart?

1

There are 1 answers

0
Ondrej Svejdar On BEST ANSWER

If you're putting this assembly into bin folder of your web application then yes - IIS actively watches bin directory of your web application & forces restart when you add or update .dll file in bin folder.

For complete list check out: Does any change in any file inside bin folder cause application recycle in ASP.NET web application?