Application.ThreadException not getting called
Posted on 2005-04-11
I am using .NET 2.0 SDK Beta and trying to trap thread exceptions in order to handle 'unhandled' exceptions and log them. I am running the following line in my Main method:
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
The method simply does a MessageBox.Show in order to indicate that it was called. However, it never does get called, instead throwing whatever exception is throw (I have hardcoded one to be thrown). Am I doing something wrong? Additional step, perhaps?