Hi Mark,
First, the fix to this issue is one of following options:
1) Create an application config file "app.config " for your project and edit:
<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>
You need to release this <yourapp>.exe.c onfig file with your main app to
your user.
2) If your purpose of installing your own exception handler is to show the
exception, you don't have to. By default, WinForm has a built-in global
exception handler which will catch the exception and show the default
exception dialog. You can also customize this dialog:
http://samples.gotdotnet.com/quickst...FormsAppErrorH
andler.aspx
To understand the background of this issue, read along.
======
The built-in exception dialog is shown because the message pump exception
handler is working.
If you use Reflector to see the disassembled code of
System.Windows. Forms.NativeWin dow, you will see two private methods
"Callback" and "DebuggableCall back". In "Callback", we wrap the message
pump in an exception handler so that unhandled exception that gets as far
as the message pump does not actually unwind the message pump causing the
app to crash.
When an application is run in the debugger, we don't catch exceptions in
NativeWindow.De buggableCallbac k because we typically want the JIT debugger
to stop the app.
We believe that the behavior we have now represents the best possible ease
of use combined with flexibility -- if you do nothing your app won't crash
if you don't handle an exception, you can customize the dialog that gets
shown and you can turn off the behavior completely.
======
Hope this helps. Please feel free to post here if anything is unclear.
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.