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

前端 未结 4 1583
清酒与你
清酒与你 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 05:52

    You can check the value of System.Web.Hosting.HostingEnvironment.ShutdownReason, when the app pool is not in the process of closing / recycling it will have the ShutdownReason of None.

提交回复
热议问题