How to detect if the current application pool is winding up in IIS7.5 and Asp.Net 3.5+

前端 未结 4 1580
清酒与你
清酒与你 2020-12-08 05:21

Well - exactly as the question subject states - any ideas on how you might do this?

I\'ve been looking over the objects in System.Web.Hosting but nothing is standing

4条回答
  •  -上瘾入骨i
    2020-12-08 05:47

    Not sure exactly what you want to do when the appication pool recycles but if you add the below event handler to Global.asax then the code in it will run when the application is shut down.

     protected void Application_End(object sender, EventArgs e)
     {
     }
    

提交回复
热议问题