Answer 1)
ASP.NET application could restart because really a lot of reasons. It
probably happens more often than you think. ASP.NET web application will restart
because of:
- Change in Web.Config file. Change of any parameter, adding
of space character or even changing file's modified date will cause app
restart.
- Change in machine.config, just like for
web.config.
- Change in /bin folder. Application will
restart if you add, update or delete any file in /bin folder.
- Change in App_Code folder. Adding, deleting or editing classes
inside App_Code will cause application restart.
- Change in
Global.asax file, like in web.config.
- Change in
App_LocalResources folder
- Change in App_GlobalResources
folder
- Change in App_WebReferences
folder
- Change in Profile configuration
- Reached compilation limit, defined with
numRecompilesBeforeAppRestart in machine.config file. Default value is 15.
ASP.NET watches for any changes in files. When certain number (15 by default) of
files is changed, web application is restarted automatically. The reason for
this is to save memory on server. On some websites where files are generated
dynamically, this could cause frequent restarts.
- Antivirus software
changes file's modified date. Antivirus program scans files like
Web.config or Global.asax. Some antivirus programs change Modified date of these
files and that cause pretty frequent restarts, which decrease website
performances.
- IIS restarts, and all websites will restart
too.
- Change of physical path to web application
- IIS recycled website due to inactivity (20 minutes by default).
If website has no visitors, IIS will unload it from memory to save resources.
Application will be started again on when next visitor comes.
|