RE: "not handled in user code" dialog
- From: jetan@xxxxxxxxxxxxxxxxxxxx ("Jeffrey Tan[MSFT]")
- Date: Tue, 18 Jul 2006 09:56:02 GMT
Hi Leslie,
Thanks for your post!
I have several questions regarding your problem context, these questions
will help us to understand your problem much better:
1. How do you implement the global error handler for Asp.net application?
Do you use Application_Error or AppDomain.UnhandledException?
2. While you are seeing this Visual Studio dialog, how do you running your
application? Do you run it under debugging or without debugging?
3. Is your Asp.net project File System based or IIS based?
Based on my experience, Asp.net Application_Error event handler can be used
to handle all the unhandled exception in main Asp.net thread. However, any
worker threads exceptions will not be catched by it. So I suspect that the
exception you have seen is generated in a worker thread.
Also, in FileSystem Asp.net project, since Asp.net is running under the
current account, the unhandled exception dialog will pop up. In IIS mode,
the Asp.net will run under another windows station, and you will not see
this dialog.
Regarding worker thread exception, there is no global exception handler for
it. In 2.0, by default the system will terminate the process if the
unhandled exception is generated in worker thread.(So was main thread,
unless you use Application_Error to handle it). So the only solution is
explicitly catching the first chance exception in that thread procedure, or
the Asp.net process will die.
Finally, there is an AppDomain.UnhandledException in .Net, which seems can
be used for all unhandled exceptions in the AppDomain. However, the
UnhandledException event is merely an event, a notification. The system
uses it to let the programmer know that an exception has gone unhandled,
before the system takes whatever action it wants to take. This event can
not be used to prevent the Asp.net process from die, but it gives you a
notification regarding the die.
If what you want is just getting the notification of the exceptions in
worker thread, you may use AppDomain.UnhandledException.
Hope this helps!
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- RE: "not handled in user code" dialog
- From: Leslie
- RE: "not handled in user code" dialog
- Prev by Date: Re: Debugging with dumps
- Next by Date: RE: "not handled in user code" dialog
- Previous by thread: Re: Debugging with dumps
- Next by thread: RE: "not handled in user code" dialog
- Index(es):
Relevant Pages
|