Is there a way to prevent Visual Studio from breaking on exceptions in a specific method?

I know I can control the way Visual Studio handles exceptions according to their type and to the fact that they're eventually caught using the "Exception" dialog.

However, I've got a library that's internally throwing (and catching) an ArgumentOutOfRange exception when I'm calling a specific method. The exception is thrown (and caught by the library) maybe 1% of the time, but I'm calling this method a lot. The editor says it's by design (and indeed, the design they've chosen makes sense).

The thing is that I don't want Visual Studio to break each time the exception is thrown.

  • I don't want to stop breaking on ArgumentOutOfRange exceptions, as I may have some in my code and want to break on those.
  • I don't want to enable "just my code" debugging because I'm concerned about the exceptions thrown outside of my code (notably for performance reasons)

Is there a way to achieve this? I've been looking into attributes (such as DebuggerStepThrough), but haven't find something adequate yet.

Any hints on how to do this ?

12
задан Cody Gray 1 March 2011 в 10:04
поделиться