Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exceptions Not Being Thrown In Visual Studio

For some reason my exceptions arent being thrown anymore in Visual Studio. I get the error in JSON on the response, but Visual Studio in debug mode no longer throws an error and stops Visual Studio at that error when it happens.

I have looked into posts like this:

Visual Studio not stopping on an exception being thrown

But I just want to reset where I was before, not enable exceptions one by one.

like image 985
Mike Flynn Avatar asked Jun 26 '13 03:06

Mike Flynn


People also ask

How do I enable exceptions in Visual Studio?

With a solution open in Visual Studio, use Debug > Windows > Exception Settings to open the Exception Settings window. Provide handlers that respond to the most important exceptions.

How do I fix exceptions in C#?

Use a try block around the statements that might throw exceptions. Once an exception occurs in the try block, the flow of control jumps to the first associated exception handler that is present anywhere in the call stack. In C#, the catch keyword is used to define an exception handler.

How do I reset Visual Studio exceptions?

To set Visual Studio debugger options, select Tools > Options, and under Debugging select or deselect the boxes next to the General options. You can restore all default settings with Tools > Import and Export Settings > Reset all settings.

How do I stop Visual Studio from breaking on exception?

To turn off stop on exceptions press " Ctrl + Alt + E ". This will open the Exceptions window . Untick "Common Language Runtime Exceptions - Thrown". That would prevent it from pausing from within the delegate, but not when it's rethrown on Wait .


2 Answers

To reset the exceptions settings, go to Debug>Exceptions and click "Reset All."

You can also drill down and control what happens for different types of exceptions.

Visual Studio 2012 menu selectionVisual Studio 2012 exceptions dialog

update

You mentioned that you are missing the User-Unhandled column. In that case, you may need to set this:

enter image description here

like image 73
Jay Avatar answered Sep 30 '22 02:09

Jay


I hit a problem where it wasn't stopping on an exception and resetting the exception settings worked for me. To expand on Jay's answer above, in VS 2019 that option to reset is in a slightly different place (arguably a step backward compared to how it was before, it's clearer there).

Go to debug -> windows -> exception settings

The reset button is now this icon here:

Reset Exception Settings

like image 36
MIP1983 Avatar answered Sep 30 '22 02:09

MIP1983