title: How to listen to IIS shutdown event in ASP.NET
body: <p>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 material.</p>
  
  <p>How can I preserve it - or how can I flush it once ASP.NET application is shutting down?</p>
  
  <p>thank you</p>