Throw exception except * here * (Visual Studio 2010 C #)

Debug Menu - Exceptions - Check "Thrown" on Common Language runtime exceptions.

When you do this, it breaks down for all exceptions that are large.

You can add other exclusions to this package, and enable or disable individual users, but with a little effort.

Is there a way to suppress the break in the debugger using the source directive? Any comment or pragma or something like that?

I have one bit of code where I can't, I don't have an exception and it's a bit of a pain when a break is debugged on it. I prefer VS to break on any thrown exception, but in this case it didn't. Thanks to

+3


source to share


1 answer


You can do this by using the DebuggerStepThrough attribute on a method that contains code that you don't want to interrupt. You should isolate specific lines of code that throw the exception into a smaller method and annotate that method with the DebuggerStepThrough attribute so that you don't affect the rest of the existing method.



+6


source







All Articles