AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_Unhan


T

Timothy Parez

Hi,

I'm using
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

in my application to handle unhandled exceptions (duuh)

but my event handler is never triggered

private static void CurrentDomain_UnhandledException(object sender,
UnhandledExceptionEventArgs e)
{
//some code goes here
}

What am I doing wrong?

Thnx.
Tim.
 
Ad

Advertisements

H

Herfried K. Wagner [MVP]

* Timothy Parez said:
I'm using
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);


in my application to handle unhandled exceptions (duuh)

but my event handler is never triggered

private static void CurrentDomain_UnhandledException(object sender,
UnhandledExceptionEventArgs e)

{
//some code goes here
}

What am I doing wrong?

If you are using Windows Forms, add a handler to 'Application.ThreadException' too
(see MSDN for more info).
 

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