We have an ASP.NET application in production(running IIS6 on Windows 2003 server) that sometimes has ".NET Runtime 2.0 Error Reporting" due to exceptions in background threads. We wanted to ignore the errors(while we will fix the cause) and specified <runtime> <legacyUnhandledExceptionPolicy enabled="true" /> </runtime>in application web.config. Unfortunately it didn't help- ASP.NET application still keep restarting, which causes "session expired" behavior.I am able to reproduce this on a sample page.On load the page saves time to Session, then started background thread, that should will exception in 5 sec.There is also a button to read the Session value, and user can click the button.During the first 5 sec clicking the button retrieves Session Value correctly, after 5 sec the click causes some delay.If teh user keep clicking the button, it still continue to work (probably for a minute), then it reports that Object reference not set to an instance of an object. - which means that session information is lost.As I understand, after the unhandled exception is thrown, IIS starts a new working application domaiin,but keep old for a minute, than replace with the new, killing session state.By the was, if legacyUnhandledExceptionPolicy set to "false", click after 5 sec causes a long delay and then the same error, indicating thatsession state is lost, is shown.We are not able to ignore exceptions in background threads, as legacyUnhandledExceptionPolicy enabled="true" suppose to do.
Version