如何告诉调试器忽略抛出异常的中断? [英] How to tell the debugger to ignore breaking on thrown exceptions?

查看:20
本文介绍了如何告诉调试器忽略抛出异常的中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框,我在其中使用第三方库验证输入.但是,当语法不正确时,这个库会抛出自定义异常.这没什么大不了的,除非你在调试.

调试时,由于 TextBox 中的文本最初总是错误的(我仍在键入它),调试器会在每个字母之后停止,直到正确为止,这在我验证每个字母时真的很烦人.

如何告诉调试器不要因为这些自定义异常而中断?

P.S.我已经尝试过滤 Debug -> Exceptions(在 Common Language Runtime Exceptions 中添加它),但这对我不起作用.调试器仍然停在调用库的那一行.

P.P.S.使用 Visual Studio 2010.

答案:

最后我和我的 PS 非常接近.这是一个非常愚蠢的错误:我在命名空间中有一个错字.感谢 Pop Catalin 和 Madhur Ahuja 指出!

解决方案

有一个例外"窗口Visual Studio ... 尝试 Ctrl-Alt-E 时调试并单击抛出"您想要的例外的复选框停止

您正在寻找相反的内容:Visual Studio:如何中断处理的异常?>

I have a TextBox in which I validate the input with a third party library. However, this library throws custom exceptions when the syntax is incorrect. This is not a real big deal, except for when you are debugging.

When debugging, since the text in the TextBox will always be initially wrong (I am still typing it), the debugger will stop after each letter until it is correct, which is really annoying as I validate with each letter.

How can I tell the debugger to not break at these custom exceptions?

P.S. I have already tried to filter the Debug -> Exceptions (added it in Common Language Runtime Exceptions), but this did not work for me. The debugger still stops at the line where the library is called.

P.P.S. Using Visual Studio 2010.

Answer:

In the end I was very close with my PS. It was a pretty silly mistake: I had a typo in the namespace. Thanks to Pop Catalin and Madhur Ahuja for pointing it out!

解决方案

There is an 'exceptions' window in Visual Studio ... try Ctrl-Alt-E when debugging and click on the 'Thrown' checkbox for the exception you want to stop on

You are looking for reverse of this: Visual Studio: How to break on handled exceptions?

这篇关于如何告诉调试器忽略抛出异常的中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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