I am using
DispatcherUnhandledExceptionEventHandler in a WPF application as shown in the code below.
public static void Main()
{
App app = new App ();
app.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler (app_DispatcherUnhandledException);
app.Run(new WPFMain (splashForm));
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = (Exception )e.ExceptionObject;
if (ex != null )
{
LogHelper .LogError(ex.ToString());
ExceptionMessageBox .Show(ex);
}
}
The issue is that whenever some exception happens in the WPFmain form, the control does go to the
CurrentDomain_UnhandledException method. But before that i get the following error message window:
Microsoft .NET framework: Unhandled exception has occurred in your application . If you click continue, the application will ignore....
Note: I don't get this window when I debug the project from Visual studio. Any input on this would be of great help
Thanks
Vishal