Search code examples
c#.netasp.netiisapplication-pool

Replacing a DLL while AppDomain is already loaded in ASP.NET


What happens if a dll is already loaded by w3wp.exe and we replace it?

Of course we can replace a dll since asp.net uses a cached version of Bin folder DLLs, but I want to know if upon replacing a dll it will load the new one or it wait until next recycling or when there's no new request.

EDIT: DLL contains a singleton class


Solution

  • From MSDN:

    If you change the .dll and write a new version of it to the Bin folder, ASP.NET detects the update and uses the new version of the .dll for new page requests from then on.