Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugger does not stop on error

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

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.

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

Source Error: ...

Stack Trace: ...

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

like image 711
tk. Avatar asked Jan 13 '13 19:01

tk.


People also ask

How do I stop running debugger?

Terminate a debug sessionClick the Stop button on the toolbar of the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).

Why does Visual Studio not stop at breakpoint?

This problem occurs because ASP.NET debugging isn't enabled on the application.

How do I stop exception breakpoint?

Remove breakpoints For non-exception breakpoints: click the breakpoint in the gutter. For all breakpoints: from the main menu, select Run | View Breakpoints Ctrl+Shift+F8 , select the breakpoint, and click Remove Delete .


2 Answers

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.

VS2015: Debug -> Windows -> Exception Settings.

VS2012: Debug -> Exceptions more details

I enabled the whole CLR Exceptions set.

like image 67
Bassem Akl Avatar answered Oct 25 '22 08:10

Bassem Akl


Make sure the exception assistant is enabled:

enter image description here

like image 23
John Koerner Avatar answered Oct 25 '22 06:10

John Koerner