简体   繁体   English

当我已经吞下异常时,如何阻止 Visual Studio 中断异常?

[英]How can I stop Visual Studio from breaking on Exceptions when I have already swallowed them?

I'm developing an application inside Visual Studio using C#. This is a simple Console application.我正在使用 C# 在 Visual Studio 中开发一个应用程序。这是一个简单的控制台应用程序。

In some places, I wish to swallow exceptions.在某些地方,我希望吞下异常。 Thus I use an empty catch block.因此我使用了一个空的catch块。 It' by design.这是设计使然。

When I hit F5, in codes of the try block of that catch block, when exceptions raise Visual Studio breaks on them.当我按 F5 键时,在该catch块的try块的代码中,当异常引发 Visual Studio 中断时。

This behavior is very annoying and reduces our debugging speed.这种行为非常烦人,会降低我们的调试速度。 I want those exceptions to not break at all.我希望这些异常根本不会中断。

How can I do that?我怎样才能做到这一点?

I searched the Options menu and I found nothing.我搜索了“选项”菜单,但一无所获。

Go to Debug > Windows > Exception Settings Go Debug > Windows > Exception Settings

A new window will open新开window

在此处输入图像描述

Uncheck Common Language Runtime Exceptions取消选中Common Language Runtime Exceptions

Maybe start the programme without debugging and if your Try block is in a Loop then you should write a continue in the catch block也许不调试就启动程序,如果你的 Try 块在循环中,那么你应该在 catch 块中写一个 continue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio不会停止打破异常 - Visual Studio will not stop breaking on exceptions Visual Studio正则表达式以匹配吞咽的异常 - Visual studio regex to match swallowed exceptions 如何在Visual Studio中调试期间停止执行所有异常? - How can I stop execution for ALL exceptions during debugging in Visual Studio? 阻止 Visual Studio 打破任务中的异常 - Stop Visual Studio from breaking on exception in Tasks 当我输入“new {”时,如何阻止Visual Studio插入“object” - How do I stop Visual Studio from inserting “object” when I type “new {” 通过FTP连接时如何停止Visual Studio 2010下载大文件 - How do I stop Visual Studio 2010 from downloading large files when connected through FTP 我如何阻止 Visual Studio 2017 在保存时构建 - How do i stop visual studio 2017 from building on save 如何阻止 Visual Studio 2010 在模板中自动生成控件? - How can I stop Visual Studio 2010 from auto generating controls in a template? 我可以以编程方式启用/禁用异常中断吗? - Can I enable/disable breaking on Exceptions programmatically? 虽然我在解决方案资源管理器中有它们但不能使用文件夹[Visual Studio 2012] - Can't use folders although I have them in Solution Explorer [Visual Studio 2012]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM