当它被抛出并被捕获时,不要在那个异常处停止调试器
在工具/异常中,我设置了在抛出异常时调试器停止的选项.不管是不是被抓到了.
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.
示例:我想忽略第 344 行的 nullreference 异常(被捕获).我想在所有其他例外情况下停止
Example: I want to ignore the nullreference exception (which is caught) on line 344 . I want to stop at all other exceptions
如果我没记错的话,您可以在包含您不想触发异常的代码的方法上使用 DebuggerStepThrough
属性.我想你可以隔离在方法中触发恼人异常的代码,并用属性装饰它.
If I recall correctly you can use a DebuggerStepThrough
attribute on the method that contains the code you don't want exception to fire. I suppose you can isolate the code that fires the annoying exception in a method and decorate it with the attribute.