How to update ASP.Net site dll without stopping site

后端 未结 1 1477
囚心锁ツ
囚心锁ツ 2021-02-09 13:32

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

相关标签:
1条回答
  • 2021-02-09 13:58

    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.

    0 讨论(0)
提交回复
热议问题