Global Error Handler

Y

yeghia \(sosy\)

Hi Guys

I have two questions.
1. Is there a way to set a handler to .NET application so that in case of
not caught exception my handler is called before application shutdown. I
want to send an email from this handler with details of error.
2. Is there a way to capture the text (with stack frame etc) displayed in a
dialog which is shown when unhandled execption is thrown

Thanks in advance for your help

Regards
Yeghia
 
N

Nathan Smith

You may want to look at EntLib for managing how exceptions are handled.
Basically what you do is attach a top level handler when the application
starts up to the AppDomain's UnhandledException event which will begin
processing of the exception through the EntLib framework.

What *you* do is create custom handlers...for example, you may make one
that takes an exception and displays a simple message box or one that
displays a "nice" window like you're referring to and then perhaps an
additional one that logs to either the event log, a logging service,
etc...

The exception framework will run through all of your handlers (if
configured to do so) which would net you having the window show up as
well as the message being logged somewhere for later viewing.

http://www.microsoft.com/downloads/details.aspx?FamilyId=0325B97A-9534-4
349-8038-D56B38EC394C&displaylang=en

-----Original Message-----
From: yeghia (sosy) [mailto:[email protected]]
Posted At: Tuesday, October 10, 2006 1:57 PM
Posted To: microsoft.public.dotnet.general
Conversation: Global Error Handler
Subject: Global Error Handler

Hi Guys

I have two questions.
1. Is there a way to set a handler to .NET application so that in case
of
not caught exception my handler is called before application shutdown. I
want to send an email from this handler with details of error.
2. Is there a way to capture the text (with stack frame etc) displayed
in a
dialog which is shown when unhandled execption is thrown

Thanks in advance for your help

Regards
Yeghia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top