How to update ASP.Net site dll without stopping the site

Is it possible to update a site dll for a precompiled site without stopping IIS.

Currently, if I try to just copy a new file to overwrite the current file, all users get runtime errors when the file is copied. Is there any way to avoid this?

+4
source share
1 answer

even if you don’t stop, any changes to the web.config file, the BIN folder, App_Data or App_Code will force the .NET compiler to execute ...

and you will lose any session variables in memory.

I use Session State in SQL mode , and if your system is configured this way, the user will remain on this site (after a longer exposition, the page will reload)

.NET will still call the compiler to compile a new set of instructions, but soon all sessions will be read from SQL Server, and since they still exist (and are not lost with a memory update), users will remain on the website with the current credentials .

it is slightly slower than the state of the In-Memory session, but much more reliable, especially with Shared hosting :), this is a way to speed up / shorten the minutes in the session, since shared hosting does not allow it to change even if you do

Session.Timeout = 5; 

their machine configuration will override everything that you do, with the SQL Session state, you can set the time, since all this is done by SQL Server.

Do not read this article to know how everything is done.

Hope this helps.

+9
source

All Articles