Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Debugger does not break on NullReferenceException, although checkbox is set in debugging options

I manually migrated a Visual Studio 2012 "website" to a "ASP web project" to be able to use environment-specific web.configs (using transformation).

After migration my debugger does not stop anymore at exceptions.

In my output view I can see that a NullReferenceException is raised, my HTTP-REST-client receives "400 bad request", but the debugger ignores that exception.

I followed the instructions to enable exceptions ( How do I allow breaking on 'System.NullReferenceException' in VS2010? ). In the dialog "debugging"=>"Exceptions..." NullReferenceExceptions are enabled and resetting all checkboxes does also not help.

Breakpoints are working as expected.

The compiler also has some strange behaviour: compilation will succeed even if the code contains syntax problems. (But this might be a separate issue)

How can I reenable the debugger?

like image 696
slartidan Avatar asked Sep 14 '25 02:09

slartidan


2 Answers

The issue seems to be fixed after I enabled "Just My Code" in "Options"=>"Debugging"=>"General". (see also Visual Studio 2013 "break on handled exceptions" not working, not breaking ).

like image 60
slartidan Avatar answered Sep 16 '25 16:09

slartidan


Is "Just my code" enabled? You should try to set it as enable and see if it works.

like image 38
Piero Alberto Avatar answered Sep 16 '25 16:09

Piero Alberto