简体   繁体   English

Visual Studio 2015在Try Catch块中引发异常

[英]Visual Studio 2015 throw exception in Try Catch block

Visual Studio 2015 always throw exception in debug mode, even if error is handled in Try Catch block, which is very annoying. 即使在Try Catch块中处理了错误,Visual Studio 2015始终在调试模式下引发异常,这非常令人讨厌。 Could You tell me why is this happening? 你能告诉我为什么会这样吗? I dont know how to switch this off.. 我不知道如何关闭此功能。

Go to Exception Settings ( Ctrl + Alt + E on my visual studio) and tick or untick the kind of exception you want to break on when they are thrown. 转到“异常设置”(在我的Visual Studio中为Ctrl + Alt + E ),然后勾选或取消选中要抛出的异常。

Edit explanation When you run in debug mode, Visual Studio believe that notifying when an exception is raised is a good way to help the developper. 编辑说明在调试模式下运行时,Visual Studio认为在引发异常时进行通知是帮助开发人员的好方法。 Even if the exception is caught. 即使捕获到异常。 The Exception Settings allows you to change this behaviour by choosing what the kind of exception should be notified or not. 异常设置允许您通过选择应通知或不通知哪种异常来更改此行为。

You have enabled first chance exception handling. 您已启用首次机会异常处理。

To disable it open Debug->Windows->Exception Settings and uncheck the exceptions you don't want to break the debugging when thrown. 要禁用它,请打开“调试”->“ Windows”->“异常设置”,然后取消选中您不想在抛出调试时中断调试的异常。 Check the link for more details. 检查链接以获取更多详细信息。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM