Unhandled exceptions causing ASP.NET to crash in .NET 2.0
Sometimes you may see an error like the following when you have an ASP.NET application that has crashed, an event message that is similar to the following may be logged in the System log:
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1009
Date: 9/28/2005
Time: 3:18:11
PM User: N/A
Computer: IIS-SERVER
Description:
A process serving application pool ‘DefaultAppPool’ terminated
unexpectedly. The process id was ‘2548’. The process
exit code was ‘0xe0434f4d’.
Additionally, an event message that is similar to the following may be logged in the Application log:
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 9/28/2005
Time: 3:18:02 PM
User: N/A
Computer: IIS-SERVER
Description:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1,
P4 app_web_7437ep-9, P5 0.0.0.0, P6 433b1670, P7 9, P8 a,
P9 system.exception, P10 NIL.
The resolution is documented in:
https://support.microsoft.com/default.aspx?scid=kb;EN-US;911816
There was a change for 2.0 so if there is an unhandled exception that occurs outside of the context of a request. If they are inside of a request, they will get wrapped into an HttpException and this won't happen.
There are a couple resolutions there, the easiest is to just change back to the 1.1 behavior by adding the following code to the Aspnet.config file located in the %WINDIR%\Microsoft.NET\Framework\v2.0.50727
<configuration>
<runtime>
<legacyUnhandledExceptionPolicy enabled="true" />
</runtime>
</configuration>