views:

39

answers:

1

Hi,

I would like Visual Studio not to enter the Debug mode when it picks up a specific exception I define (i.e. BusinessException is this case). This is because I have a specific global error handler that will then present this to the user.

Is there a way to avoid the VS debug pickup for this exception (so I'll go straight to seeing my exception handler dialog) but for other exceptions to still be handed by the VS debugging.

I'm using VS2008 for a C# project (winforms).

thanks

EDIT: Further clarification - currently I see (a) VS pick them up and show them in the debugger, and after I hit continue I see (b) them in my custom exception handler. What I want to do is disable step (a) for certain types of exceptions. I know that I can disable totally in VS by going to the settings and uncheck "Enable just my code", however that's not quite what I want.

A: 

May be you can try DEBUG Preprocessor http://www.csharphelp.com/2005/12/c-languages-preprocessor-directives/

Ravisha
Not sure how to use this to trigger VS not to debug this exception though?
Greg
try{//code which might throw exception}catch(BusinessException ){#if DEBUG#elsethrow;#end if}
Ravisha
But then I won't see it in my custom error handler per my requirement
Greg