如何仅在未处理的异常上使 Visual Studio 中断? [英] How to make visual studio break only on unhandled exceptions?

查看:37
本文介绍了如何仅在未处理的异常上使 Visual Studio 中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的其他机器上,当没有 try/catch 来处理它们时,Visual Studio 总是因错误而中断,但如果有 try/catch 则它没有中断.

On my other machines, Visual Studio always broke on errors when there was not a try/catch to handle them, but if there was a try/catch then it didn't break.

出于某种原因,在这台笔记本电脑上,它不能那样工作.一开始它根本没有中断,但后来我发现了如何通过调试/异常将其设置为中断.但是,将其配置为在那里中断会导致它始终在异常时中断,即使存在 try/catch 块也是如此.

For some reason, on this laptop, it doesn't work that way. It didn't break at all at first, but then I found out how to set it to break by going to debug/exceptions. However, configuring it to break there causes it to always break on exceptions even if there is a try/catch block.

我如何让它像以前一样工作?

How do I make it work like I'm used to?

推荐答案

通过进入工具-->选项-->调试器-->常规--确保您已仅启用我的代码> 启用仅我的代码.这将更改您的调试--> 异常对话框以显示用户未处理错误的复选框.

Make sure you have Just My Code Enabled by going into Tools-->Options-->Debugger-->General--> Enable Just My Code. This will change your Debug--> Exceptions Dialog Box to show a CheckBox for User-unhandled Errors.

这篇关于如何仅在未处理的异常上使 Visual Studio 中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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