Process End on Application_End
You can define conditions for ending (and restarting) the IIS worker process, e.g. changed file in the ..\bin directory.
In the settings.xml in the <update.web>
section
define a <TerminateOnApplicationEnd/>
element containing the exit
reasons.
Example:
<TerminateOnApplicationEnd>
<ExitOn>
<ExitReason>BinDirChangeOrDirectoryRename</ExitReason>
<ExitReason>BrowsersDirChangeOrDirectoryRename</ExitReason>
<ExitReason>ChangeInGlobalAsax</ExitReason>
<ExitReason>ChangeInSecurityPolicyFile</ExitReason>
<ExitReason>CodeDirChangeOrDirectoryRename</ExitReason>
<ExitReason>ConfigurationChange</ExitReason>
<ExitReason>HttpRuntimeClose</ExitReason>
<ExitReason>InitializationError</ExitReason>
<ExitReason>MaxRecompilationsReached</ExitReason>
<ExitReason>None</ExitReason>
<ExitReason>PhysicalApplicationPathChanged</ExitReason>
<ExitReason>ResourcesDirChangeOrDirectoryRename</ExitReason>
<ExitReason>UnloadAppDomainCalled</ExitReason>
<!-- No exit for the following-->
<!--ExitReason>BuildManagerChange</ExitReason-->
<!--ExitReason>HostingEnvironment</ExitReason-->
<!--ExitReason>IdleTimeout</ExitReason-->
</ExitOn>
</TerminateOnApplicationEnd>
For details on all available exit reasons, >> http://msdn.microsoft.com/en-us/library/system.web.applicationshutdownreason.aspx.