gpt4 book ai didi

c# - 如何告诉调试器忽略抛出的异常中断?

转载 作者:IT王子 更新时间:2023-10-29 04:42:54 25 4
gpt4 key购买 nike

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

调试时,由于 TextBox 中的文本一开始总是错误的(我仍在输入它),调试器将在每个字母后停止,直到它正确为止,这在我验证每个字母时真的很烦人。

如何告诉调试器不要在这些自定义异常时中断?

附言我已经尝试过滤 Debug -> Exceptions(将其添加到 Common Language Runtime Exceptions 中),但这对我不起作用。调试器仍然停在调用库的那一行。

附言使用 Visual Studio 2010。

For the non-believers

回答:

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

最佳答案

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: How to break on handled exceptions?

关于c# - 如何告诉调试器忽略抛出的异常中断?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4499473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com