LONG IIS Delay when changing Managed DLLs
Posted on 2008-10-30
I have an application where the entry point is a fairly simple .aspx page, and .cs code behind. The code behind links to other managed dlls - in the bin directory - using Assembly.Load. Which dll it links to is dependant on input from the browser, and dlls can be added, removed, changed etc extremely rapidly while developing an application.
The issue I have is, that whenever a DLL is changed, the next Web interaction - the next time the .aspx is run - there is a delay of a couple of minutes, I assume while Windows does something because it knows that a managed DLL has been changed. Please note that 'changed' here also means 'touched', i.e. recompiling c# code without changing the code, i.e. wirthout changing the contents of the .DLL causes this as well.
This does not seem to be IIS starting up or anything - if I restart the machine for example I get a delay of say 20 seconds the first time the .aspx is run. It is the delay of 2 or so minutes whenever a DLL is changed that is causing the issue/that I do not understand.
The dll that has been changed may not even be used on this submission/connection to the .aspx page - and the delay still occurs.
If anyone could explain why this occurs, that would be great! If anyone could explain how to resolve this - for example, some way to make Windows process or whatever only the dlls that have actually been changed - that would be even better!
I am fairly new to ASP.NET and C#, and I apologise if I have used any unclear etc terms as a result. In case it matters this occurs both on Windows XP Professional and Vista Home Premium. I am using the csc compiler from Visual C# Express Edition 2008 - i.e. I am compiling the dlls from the command line, not via the Visual Studio interface.
Thanks in advance,