Search

legacyUnhandledExceptionPolicy enabled="true" doesn't prevent ASP.NET application restarting. by Michael Freidgeim

Closed
as Fixed Help for as Fixed

1
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 264618
Opened: 3/21/2007 6:37:15 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
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 that
session state is lost, is shown.

We are not able to ignore exceptions in background threads, as legacyUnhandledExceptionPolicy enabled="true" suppose to do.
Details (expand)
Product Language
English

Version

Visual Studio 2005 (All Products and Editions) Service Pack 1
Operating System
Windows Server 2003
Operating System Language
English
Steps to Reproduce
Described above.
I will attach the sample page, that I was using for testing.
Alternatively it's posted at http://forums.asp.net/thread/1612334.aspx


Actual Results
Application restarts, killing session state.
Expected Results
Ignore exceptions in background threads when legacyUnhandledExceptionPolicy enabled="true"
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
1 attachments
ThrowExceptionInBackground.aspx
Sign in to post a comment.
Posted by Microsoft on 3/22/2007 at 12:26 AM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see http://support.microsoft.com).

Thank you,
Visual Studio Product Team
Posted by Microsoft on 3/22/2007 at 9:03 PM
Thanks for your feedback.We have reproduced this bug on Visual Studio 2005 SP1 , and we are sending this bug to the appropriate group within the Visual Studio Product Team for triage and resolution.

Thank you,
Visual Studio Product Team.
Posted by Microsoft on 3/26/2007 at 6:54 PM
Hello,

Some of these configuration settings are not very well documented. The setting that you would like to change is only valid in the aspnet.config file. The file is passed to CorBindToRuntimeHost when ASP.NET loads the CLR. If you make a change similar to the one below and restart the worker process, everything should work as expected.

C:\>type %WINDIR%\Microsoft.NET\Framework\v2.0.50727\aspnet.config
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
    <runtime>
        <legacyUnhandledExceptionPolicy enabled="true" />
        <legacyImpersonationPolicy enabled="true"/>
        <alwaysFlowImpersonationPolicy enabled="false"/>
        <SymbolReadingPolicy enabled="1" />
    </runtime>
</configuration>

Thank you!