I've set up the UnhandledExceptionEventHandler delegate in a console
application (Main()) to handle any exceptions that bubble up from the stack
and are not handled explicitly by other try/catch blocks. The delegate
method logs the exceptions and treats them as unrecoverable, since they are
not known at design time, and exits the application. The problem I have is
that even in the release version of the application, the JIT debugger dialog
will show before passing the exception to the delegated handler, even when
running the Release code outside of the VS.Net environment.
I've read some articles on registry hacks to disable JIT debugger to get
around this, but I've chosen not to go that route. Instead, I've adopted
the Main() -> SubMain() method, wrapping the SubMain() call in a try/catch
block in Main() to process any escaped exceptions. I like the idea of using
a delegate method, but it just doesn't appear to work as expected.
So, my question is this... Is this the designed behavior of the
UnhandledExceptionEventHandler? If so, what is the purpose of using this
method if the user is prompted with a cryptic JIT debug notice (or worse,
the server process hangs with the dialog window)? If it's not intended
behavior, will we see it corrected in VS 2005?
Any insight would be greatly appreciated.
Thanks,
- Glen