In tools/exceptions, I've set the option that the debugger stops when an exception is thrown. Whether it is caught or not .
How do I exclude an exception of that rule? Somewhere in my code there is a caught exception that is part of the program logic. So I obviously don't want that exception to stop the debugger each time it is hit.
Example: I want to ignore the nullreference exception (which is caught) on line 344 . I want to stop at all other exceptions
Best Answer
DebuggerHidden
is your friend!Tested on VS2010 and works great.
While
DebuggerStepThrough
seems to also work for some specific debugger versions,DebuggerHidden
seems to work for a wider range of situations based on the comments to both answers.Note that both options do not currently work with iterator block methods or for async/await methods. This could be fixed in a later update of Visual Studio.
Note that it does not work with combination of .NET Core + Rider, you can vote the issue.