Exception Handling

J

Jeff

Hello,

I have a Windows Forms application in which I've implemented custom
exception handling for most of the UI-related methods. If an exception
occurs, it is "caught" and passed on to a standard exception handler that
will format and display the error information and give the user a chance to
copy, print, e-mail, etc.

I have a problem in that I would like the exceptions to -not- be handled
during debug mode. In other words, during debug mode I would like any
exceptions to break into the VS .NET debugger and not display my custom
exception handler dialog. I only want the custom exception handler to work
during the "release" version.

Is there any way of implementing this short of me having to put #if's and
#end if's around all my try-catch-finally blocks?

--- Thanks, Jeff
 
J

Jay B. Harlow [MVP - Outlook]

Jeff,
I would leave the exception handlers alone, and just change the options
under 'Debug - Exceptions'.

Select 'Common Language Runtime Exceptions', then change either or both of
'When the exception is thrown' and 'if the exception is not handled'.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top