We have registered for the unhandled exceptions in the following way. The application is a remoting server. If an unhandled exception is thrown from the remoting server it is not handled by the unhandled exception handlers. What could be the problem?
[STAThread]
[Obfuscation(Exclude = true)]
static void Main(string[] args)
{
Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
.
.
.
Application.EnableVisualStyles();
Application.Run(form);
}
Hope this method helps you ‘Application.SetUnhandledExceptionMode‘. It instructs the application how to respond to unhandled exceptions.