I have a custom exception handler that "wraps" an entire application. Basically, all it does is make
things easier on my beta testers by letting them click a button to copy all the information I want
on an exception to the clipboard, from where they can paste it into an email to me. This works fine
on my development machine when I'm running the app under the VS debugger.
However, on my testers' machines, which don't have VS installed, they don't see my handler; they see
a request asking them if they want to invoke the JIT debugger. I'd prefer that they not see this.
Is there a way to suppress the Framework's request to invoke the JIT debugger when an exception
occurs?
- Mark
Cowboy (Gregory A. Beamer) - MVP - 25 Jan 2005 00:21 GMT
Try setting up debug versus production code rather than suppressing the JIT
compiler. Remember that HIT compilation is necessary for apps, unless you
native compile.
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************
Think outside the box!
************************************
> I have a custom exception handler that "wraps" an entire application. Basically, all it does is make
> things easier on my beta testers by letting them click a button to copy all the information I want
[quoted text clipped - 8 lines]
>
> - Mark
Mark Olbert - 25 Jan 2005 16:24 GMT
Sorry, that won't work in my situation at this point. I need to keep building and distributing the
debug code.
I'm not trying to suppress JIT >>compilation<<, just the "do you want to invoke the JIT Debugger?"
window that pops up when the app crashes. I have my own custom "global exception handler" form that
I want to appear, instead.
- Mark
>Try setting up debug versus production code rather than suppressing the JIT
>compiler. Remember that HIT compilation is necessary for apps, unless you
[quoted text clipped - 20 lines]
>>
>> - Mark
saurabh - 28 Jan 2005 10:12 GMT
Why was this reply lost yesterday ? Its definitely there in my sent messages
-----------------------------------------
"First chance exception"
You application is the first to get the chance to see the exception but
there are circumstances where it does not happen. I am sure you have caught
Exception at top level so that nothing gets filtered through.
The other thing is, in winforms if one of your dialog throws an exception,
and you are catching it in the code which launched the form, the JIT
debugger gets there before you thinking that the exception is going
unhandled. you also need 2 more things they are
1) Subscribe to the UnhandledException event on your AppDomain to catch any
exception as follows :
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
2) Catch the thread exceptions that might have been thrown from the
Winforms thread.
System.Windows.Forms.Application.ThreadException += new
ThreadExceptionEventHandler(Application_ThreadException);
This will ensure that your dialog always gets invoked (of course if you
write relevant code in the above 2 handlers ;))
Since after getting these exceptions, your application *may* be in an
undetermined state so quite a few people recommend closing the application
if you get these exceptions.
HTH,
--Saurabh
> Sorry, that won't work in my situation at this point. I need to keep
> building and distributing the
[quoted text clipped - 40 lines]
>>>
>>> - Mark
Mark Olbert - 29 Jan 2005 15:57 GMT
Don't know. FWIW, I saw it. Thanx!
- Mark
>Why was this reply lost yesterday ? Its definitely there in my sent messages
>-----------------------------------------
[quoted text clipped - 74 lines]
>>>>
>>>> - Mark
saurabh - 27 Jan 2005 17:17 GMT
"First chance exception"
You application is the first to get the chance to see the exception but
there are circumstances where it does not happen. I am sure you have caught
Exception at top level so that nothing gets filtered through.
The other thing is, in winforms if one of your dialog throws an exception,
and you are catching it in the code which launched the form, the JIT
debugger gets there before you thinking that the exception is going
unhandled. you also need 2 more things they are
1) Subscribe to the UnhandledException event on your AppDomain to catch any
exception as follows :
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
2) Catch the thread exceptions that might have been thrown from the
Winforms thread.
System.Windows.Forms.Application.ThreadException += new
ThreadExceptionEventHandler(Application_ThreadException);
This will ensure that your dialog always gets invoked (of course if you
write relevant code in the above 2 handlers ;))
Since after getting these exceptions, your application *may* be in an
undetermined state so quite a few people recommend closing the application
if you get these exceptions.
HTH,
--Saurabh
>I have a custom exception handler that "wraps" an entire application.
>Basically, all it does is make
[quoted text clipped - 14 lines]
>
> - Mark