在该异常时,它的抛出和捕获不停止调试器它的、抛出、异常、调试器

2023-09-02 21:22:39 作者:醉模样

在工具/例外,我给自己定的选项,当一个异常被抛出调试器停止。无论是抓还是不。

In tools/exceptions, I've set the option that the debugger stops when an exception is thrown. Whether it is caught or not .

如何排除例外的规则?某处在我的code有一个捕获的异常就是程序逻辑的一部分。因此,我显然不希望出现这种情况例外,每次被击中停止调试程序。

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.

例如:我想忽略nullreference异常(它被捕获)上线344。我想停止在所有其他异常

Example: I want to ignore the nullreference exception (which is caught) on line 344 . I want to stop at all other exceptions

推荐答案

如果我没有记错,你可以使用包含code中的方法 DebuggerStepThrough 属性你不想例外火。我想你可以隔离code,在一个方法触发恼人的异常,并用属性装饰它。

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.