2013-01-13 89 views
5

我使用Visual Studio 2012调试器不会停止在错误

当有调试过程中发生错误,它曾经停止在错误的Asp.net MVC4项目。

但突然间,调试器不会停止,只是吐出了错误信息的网页象下面。

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.

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

Source Error: ...

Stack Trace: ...

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

+0

你在调试模式(F5)开始?或者在非调试模式下(ctrl-F5)? –

+0

我想我有同样的问题。检查[这里](http://stackoverflow.com/questions/14156666/visual-studio-does-not-break-on-unhandled-exceptions-when-debugging)。 – Schaliasos

回答

6

确保异常助手启用:

enter image description here

+0

它已启用。 –

+6

与您的设置进行比较后,我启用了“Just My Code”,现在就可以使用!日Thnx。 –

+0

“异常评估”现在在VS2017中被称为“使用新的异常帮助程序”。 –

4

我有同样的问题,甚至我的调试选项是一样的@约翰克尔纳。 我发现并不是所有的异常类型都可以默认打破解决方案。您可以从例外设置窗口中选择启用哪些。

VS2015:调试 - >窗口 - >例外设置。

VS2012:调试 - >例外more details

我启用集全CLR例外。