I’ve installed visual studio 2010.
When unhandled exception is thrown, nothing happen…
I created new windows form application and wrote 1 line in the form_load function:
private void Form1_Load(object sender, EventArgs e)
{
throw new Exception("");
}
And still nothing happen. The only thing I can see is the “A first chance exception of type ‘System.Exception’ occurred in WindowsFormsApplication1.exe” in the output window.
It looks like this error was catch but I dont know how… (This line is the only line I wrote in this project).
How can I solve this issue?
Thanks!
You could also register your program for the
UnhandledExceptionEvent. To do so write the following into your Program.cs before callingApplication.Run(new MyForm()):AppDomain.CurrentDomain.UnhandledException += OnCurrentDomainUnhandledException;Then declare your event catcher like
private static void OnCurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)and do what ever you want to do with that exception.