Robbert Dam
Robbert Dam

Reputation: 4107

Handle exceptions in AppDomain.CurrentDomain.UnhandledException

Is it possible to handle exceptions on the AppDomain.CurrentDomain.UnhandledException callback? I want to do the following:

Can this be done?

Upvotes: 5

Views: 6055

Answers (2)

Pedro
Pedro

Reputation: 11854

Hope this link helps:

http://www.switchonthecode.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions

As the code shows, just listen to the exception and do what you want when it happens.

Upvotes: 2

Rubens Farias
Rubens Farias

Reputation: 57936

You could to use Application.SetUnhandledExceptionMode method.

Please, take also a look here: User Friendly Exception Handling.

Upvotes: 2

Related Questions