3

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?

Community
  • 1
  • 1
slartidan
  • 20,403
  • 15
  • 83
  • 131
  • 2
    I the Debug -> Windows -> Exception Settings -> Common Language Runtime Exceptions Make sure that the checkbox System.NullReferenceException is checked. – pstorli Mar 29 '19 at 16:11

2 Answers2

7

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 ).

Community
  • 1
  • 1
slartidan
  • 20,403
  • 15
  • 83
  • 131
3

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

Piero Alberto
  • 3,823
  • 6
  • 56
  • 108
  • 1
    ops, I see you beat me! :P – Piero Alberto Feb 13 '15 at 09:36
  • :P But by the way: do you know WHY I have to "enable" this setting? It seems counter intuitive. The "Just" seemed to reduce the breakpoints - but extended the breakpoints instead. – slartidan Feb 13 '15 at 09:56
  • can this help you? https://msdn.microsoft.com/en-us/library/h5e30exc%28VS.80%29.aspx – Piero Alberto Feb 13 '15 at 10:03
  • @slartidan, look at Andrew Hall's answer on the link you yourself have given in your answer. http://stackoverflow.com/a/21470432/17447 :) Downvoter: why? – naveen Feb 13 '15 at 10:08