How to update ASP.Net site dll without stopping site

随声附和 提交于 2019-12-04 12:53:10

问题


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

Currently, if I try to just copy the new file to overwrite the current file, All users receive runtime errors while the file is being copied. Is there a way to avoid this?


回答1:


even if you don't stop, any change to the web.config file, BIN folder, App_Data or App_Code will force the .NET compiler to perform ...

and you will loose any Session variables in memory.

What I do is to use Session State in SQL Mode and if your system is set up like this, user will remain in the site (after a longer exposition to a page reload)

.NET will still invoke the compiler in order to compile the new set of instructions but soon it is done, all sessions will be read from SQL Server and because they are still there (and not lost with a memory refresh) users will remain in the website with current credentials.

it is a little bit slower than In-Memory Session State, but much more reliable, specially with Shared hosting :) this is the way to increse/decrese the minutes in your session, as Shared hosting do not allow it to change even if you do

Session.Timeout = 5;

their machine configuration will override everything you do, with SQL Session State, you will be able to set your time as this is all made by SQL Server.

Fell free to read this article to know how everything is done.

Hope it helps.



来源:https://stackoverflow.com/questions/1602186/how-to-update-asp-net-site-dll-without-stopping-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!