在该异常时,它的抛出和捕获不停止调试器 [英] Don't stop debugger at THAT exception when it's thrown and caught

查看:262
本文介绍了在该异常时,它的抛出和捕获不停止调试器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于在该异常时,它的抛出和捕获不停止调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆