How to listen to IIS shutdown event in ASP.NET

前端 未结 4 1529
小鲜肉
小鲜肉 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:34

    Its kind of risky to rely on application shutdown events to keep a database updated. If IIS is force restarted, recycled or there is a power outage, then you are going to miss the event.

提交回复
热议问题