How to listen to IIS shutdown event in ASP.NET

前端 未结 4 1538
小鲜肉
小鲜肉 2020-12-06 09:57

I have in my ASP.NET static variable that flushes itself to DB every X insertions. Problem is, if I publish the application , the IIS process is killed with all my static ma

4条回答
  •  暖寄归人
    2020-12-06 10:59

    Global.asax

    void Application_End(object sender, EventArgs e) 
        {
            //  SHUTDOWN CODE HERE
        }
    

提交回复
热议问题