S
Steve Podradchik
Hi,
For our app, we'd like to have basically the same functionality as what .Net
automatically provides if an unhandled error somehow occurs in the app.
That is, the user sees some sort of warning and then, generally, the app
continues merrily along as if nothing had happened. This is typically what
we get with our app today, rather automatically. The only thing we'd like
to do is:
1. Replace the "An unhandled exception has occurred..." msg. with something
we write and
2. Have our app automatically capture the error message and stack trace and
send it to us (yes, after asking the user if that's OK).
How do we do that? We tried using a Try/Catch block around everything in
Main() and tried adding an event handler to AppDomain.UnhandledException.
When using a simple Try/Catch, the app ended after an error -- not what we
wanted. When adding a handler via AppDomain.UnhandledException, the event
simply seemed to never fire with Release code. In Debug code, the event
fired -- *after* the default .Net "An unhandled exception..." message!
So .. is there a simple way to basically trap an unexpected errors, send
them back to us, then continue the app if possible?
Thanks, Steve
For our app, we'd like to have basically the same functionality as what .Net
automatically provides if an unhandled error somehow occurs in the app.
That is, the user sees some sort of warning and then, generally, the app
continues merrily along as if nothing had happened. This is typically what
we get with our app today, rather automatically. The only thing we'd like
to do is:
1. Replace the "An unhandled exception has occurred..." msg. with something
we write and
2. Have our app automatically capture the error message and stack trace and
send it to us (yes, after asking the user if that's OK).
How do we do that? We tried using a Try/Catch block around everything in
Main() and tried adding an event handler to AppDomain.UnhandledException.
When using a simple Try/Catch, the app ended after an error -- not what we
wanted. When adding a handler via AppDomain.UnhandledException, the event
simply seemed to never fire with Release code. In Debug code, the event
fired -- *after* the default .Net "An unhandled exception..." message!
So .. is there a simple way to basically trap an unexpected errors, send
them back to us, then continue the app if possible?
Thanks, Steve