2013-01-13 112 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例外。