In my web application Application.End
is called after every request for some reason and the application is restarted. When I set a breakpoint in Applicaion_End
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:
- Adding, modifying, or deleting assemblies from the application's Bin
folder.
- Adding, modifying, or deleting localization resources from the
App_GlobalResources or App_LocalResources folders.
- Adding, modifying, or deleting the application's Global.asax file.
- Adding, modifying, or deleting source code files in the App_Code
directory.
- Adding, modifying, or deleting Profile configuration.
- Adding, modifying, or deleting Web service references in the
App_WebReferences directory.
- Adding, modifying, or deleting the application's Web.config file.
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?
Edit: 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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…