调试器不会因错误而停止

时间:2021-08-01 20:54:16

I'm working on Asp.net MVC4 project using Visual Studio 2012.

我正在使用Visual Studio 2012开发Asp.net MVC4项目。

When there's an error during debugging, it used to stop on the error.

在调试期间出现错误时,它会用于停止错误。

But suddenly, the debugger does not stop and just spit out the error information webpage like below.

但突然间,调试器不会停止,只是吐出错误信息网页,如下所示。

Server Error in '/' Application.

'/'应用程序中的服务器错误。

The given key was not present in the dictionary.

给定的密​​钥不在字典中。

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

异常详细信息:System.Collections.Generic.KeyNotFoundException:给定的键不存在于字典中。

Source Error: ...

来源错误:......

Stack Trace: ...

堆栈跟踪: ...

How can I set the debugger to stop on the error?

如何设置调试器以停止错误?

2 个解决方案

#1


6  

Make sure the exception assistant is enabled:

确保启用了例外助手:

调试器不会因错误而停止

#2


5  

I had the same problem, even my debugging options are the same as @John Koerner. I found that not all exception types are enabled to break the solution by default. You can choose which are enabled from the Exception Setting window.

我有同样的问题,甚至我的调试选项与@John Koerner相同。我发现默认情况下并非启用所有异常类型来破解解决方案。您可以从“异常设置”窗口中选择启用哪些。

VS2015: Debug -> Windows -> Exception Settings.

VS2015:调试 - > Windows - >异常设置。

VS2012: Debug -> Exceptions more details

VS2012:调试 - >例外更多细节

I enabled the whole CLR Exceptions set.

我启用了整个CLR异常集。

#1


6  

Make sure the exception assistant is enabled:

确保启用了例外助手:

调试器不会因错误而停止

#2


5  

I had the same problem, even my debugging options are the same as @John Koerner. I found that not all exception types are enabled to break the solution by default. You can choose which are enabled from the Exception Setting window.

我有同样的问题,甚至我的调试选项与@John Koerner相同。我发现默认情况下并非启用所有异常类型来破解解决方案。您可以从“异常设置”窗口中选择启用哪些。

VS2015: Debug -> Windows -> Exception Settings.

VS2015:调试 - > Windows - >异常设置。

VS2012: Debug -> Exceptions more details

VS2012:调试 - >例外更多细节

I enabled the whole CLR Exceptions set.

我启用了整个CLR异常集。