There are several conditions that will cause an application domain to shut down and restart.
When ASP.NET must restart an AppDomain, it simply removes the entry in the table that points to the AppDomain. When a new request arrives, the table does not have an entry; therefore, ASP.NET creates a new AppDomain that handles all of the future requests. The old AppDomain continues running until it completes all of its current requests. Finally, the old AppDomain shuts down.
The following changes will cause an AppDomain to restart:
When ASP.NET must restart an AppDomain, it simply removes the entry in the table that points to the AppDomain. When a new request arrives, the table does not have an entry; therefore, ASP.NET creates a new AppDomain that handles all of the future requests. The old AppDomain continues running until it completes all of its current requests. Finally, the old AppDomain shuts down.
The following changes will cause an AppDomain to restart:
- Configuration change—If the machine.config or Web.config files are changed, ASP.NET detects the change and restarts the affected AppDomain.
- Global.asax change—If the global.asax file is changed, ASP.NET detects the change and restarts the affected AppDomain.
- Bin directory change—If an assembly in the bin directory is changed, ASP.NET restarts the AppDomain that corresponds to that bin directory.
- Compilation count change—When an ASP.NET Web page is changed, it is recompiled. You can set a compilation element in the Web.config file that specifies how many times a Web page can be recompiled before ASP.NET restarts the AppDomain. Each Web page recompile degrades an application domain’s performance; establishing a recompiling limit therefore helps control the overall performance of the Web application.
Comments