Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 460
Xaqron Avatar asked May 31 '11 04:05

Xaqron


2 Answers

Your application will be compiled again once a dll is modified or added.

Your application's domain will be recycled when any change occurs in the bin directory or if its contents are modified.

like image 70
Muhammad Akhtar Avatar answered Nov 19 '22 05:11

Muhammad Akhtar


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.

like image 31
Alex Aza Avatar answered Nov 19 '22 04:11

Alex Aza