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

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

问题描述

我有一个TextBox,其中使用第三方库验证输入。但是,当该语法不正确时,此库会引发自定义异常。这不是一个真正的大事,除了当你正在调试。

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.

调试时,由于TextBox中的文本将始终是错误的(我仍在键入它),调试器将在每个字母后停止,直到它是正确的,这是非常烦人的,因为我验证每个字母。

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.

我如何告诉调试器不会破坏这些自定义例外?

PS我已经尝试过滤调试 - >异常(将它添加到通用语言运行时异常),但这对我来说不起作用。调试器仍然停在库调用的行。

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。使用Visual Studio 2010。

P.P.S. Using Visual Studio 2010.

答案:

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

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!

推荐答案


有一个'例外'窗口在
Visual Studio ...尝试Ctrl-Alt-E当
调试并单击'Thrown'
复选框,您要
停止在

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

您正在寻找与之相反的方向:
Visual Studio:如何打破处理的异常?

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

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

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