Visual Studio不会破坏用户未处理的异常

BVe*_*non 44 ide debugging exception visual-studio-2012

在Visual Studio中运行我的应用程序时,它以未处理的异常结束,而不是显示带有异常信息的消息框,并继续按照我习惯的方式继续.

我需要更改哪些选项才能恢复到我习惯的行为?

编辑:在调试/异常中我确实为CLR异常选择了User-unhandled选项.

Tom*_*dee 32

Debug->Exceptions->Check Thrown/User-Unhandled 对于公共语言运行时异常

编辑:也许尝试进行清理/重建,然后再次运行?也许调试符号是腐败的东西..

  • 自VS 2015:Debug> Windows> [Exception Settings](https://blogs.msdn.microsoft.com/visualstudioalm/2015/02/23/the-new-exception-settings-window-in-visual-studio-2015 /)或`Ctrl + Alt + E` (9认同)
  • 我正在调试/选项和设置/调试/常规,但我没有看到该选项.我在正确的地方寻找吗? (4认同)
  • 在VS 2015中没有这样的复选框吗? (2认同)

Rab*_*olf 27

对于visual studio 2015:

1.打开例外设置窗口(2015年新增) 打开例外设置窗口(2015年新增)

2.检查所有CLR例外 在此输入图像描述

3.如果您不需要visual studio来抛出特定的异常,请取消选中此项 在此输入图像描述

  • 我打开异常窗口并单击“重置为默认值”,这解决了我在VS2017中的问题 (3认同)

Sam*_*ell 20

根据应用程序的不同,以下选项可能对您有所帮助:

工具→选项...→调试→常规

  • 异常跨越AppDomain或托管/本地边界时中断(仅限托管)
  • Enable the exception assistant
    • Unwind the call stack on unhandled exceptions
  • Uncheck Enable Just My Code ← JMC can prevent you from catching exceptions in code that's not yours and/or is missing symbols.

  • **禁用***启用Just My Code*导致Visual Studio隐藏*Exceptions*窗口中的*User-unhandled*列,并阻止Visual Studio打破*任何*用户未处理的异常.所以在我的情况下,你的指示实际上导致了这个问题试图解决的问题! (9认同)

Sam*_*Sam 17

就我而言,当我进入Debug - > Exceptions时,缺少User-unhandled列.转到Debug - > Options and Settings并启用Enable Just My Code修复此问题,从而完全解决了这个问题.