C
Chris Dunaway
I have a Windows forms app which is started from a sub Main. In Sub
main I have this line:
AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf
Form1.UnhandledExceptionHandler
And I also have the method, UnhandledExceptionHandler with the proper
signature. The handler logs details of the exception to a log file as
well as sending an EMail. When I run the program through the IDE,
exceptions are caught by this handler and the appropriate logs and
emails are successfully sent.
If I run the exe directly, outside of the IDE, I get a MsgBox that says
"An unhandled exception has occurred in your application....." with a
Details, Continue and Quit buttons. When I click the Details button I
see the exception message and stack trace but for some reason my
handler does not get called. I have even attached to the process with
the debugger and set a breakpoint but it never gets hit.
Why does the code catch the error in the IDE but not when run outside
the IDE? Someone suggested to me that there was bug introduced with
version 1.1 of the framework. Does anyone have any information on
this?
Thanks,
Chris
main I have this line:
AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf
Form1.UnhandledExceptionHandler
And I also have the method, UnhandledExceptionHandler with the proper
signature. The handler logs details of the exception to a log file as
well as sending an EMail. When I run the program through the IDE,
exceptions are caught by this handler and the appropriate logs and
emails are successfully sent.
If I run the exe directly, outside of the IDE, I get a MsgBox that says
"An unhandled exception has occurred in your application....." with a
Details, Continue and Quit buttons. When I click the Details button I
see the exception message and stack trace but for some reason my
handler does not get called. I have even attached to the process with
the debugger and set a breakpoint but it never gets hit.
Why does the code catch the error in the IDE but not when run outside
the IDE? Someone suggested to me that there was bug introduced with
version 1.1 of the framework. Does anyone have any information on
this?
Thanks,
Chris