title: How to find out why an ASP.NET web application is being restarted
body: <p>In my web application <code>Application.End</code> is called after every request for some reason and the application is restarted. When I set a breakpoint in <code>Applicaion_End</code> I don't get a useful stack trace. Furthermore, there are no entries in Event Viewer. According to MSDN, the following could cause an application restart:</p>
  
  <blockquote>
    <ul>
    <li>Adding, modifying, or deleting assemblies from the application's Bin
    folder.   </li>
    <li>Adding, modifying, or deleting localization resources from the
    App_GlobalResources or App_LocalResources folders.</li>
    <li>Adding, modifying, or deleting the application's Global.asax file.</li>
    <li>Adding, modifying, or deleting source code files in the App_Code
    directory.</li>
    <li>Adding, modifying, or deleting Profile configuration.</li>
    <li>Adding, modifying, or deleting Web service references in the
    App_WebReferences directory.</li>
    <li>Adding, modifying, or deleting the application's Web.config file.</li>
    </ul>
  </blockquote>
  
  <p>I guess that my code changes some file which triggers an application restart. Is there any way to find out what exactly causes the application restarts?</p>
  
  <p><strong>Edit:</strong> I solved my problem now by stepping through the code and watching the timestamps in Explorer. On application startup I'm reading a value from an access database which causes a .ldb file to be created and deleted. However, this question has not been answered yet. Is there any log that keeps record of such events that cause the application to be restarted?</p>