8

I've being messing with the debug options and now all my exceptions are like

System.NullReferenceException crossed a native/managed boundary.

Sometimes, when an exception occurs VS asks me to open some .net .cs file as if I have the source code. I wish there is some "Restore Defaults" button. Any idea what do I need to switch to make it work as it normally would?

Juan
  • 15,274
  • 23
  • 105
  • 187
  • 1
    I have the same problem, but since 99.9% of my code is unmanaged, I always choose "Native Code Only" in the debugger and now I have the correct call stack again. Seems like Microsoft does not like people doing mixed mode developments. – Patrick Nov 15 '10 at 08:23

2 Answers2

15

Solution found here ("an option in Visual Studio 2010 called "Break when exceptions cross AppDomain or managed/native boundaries (Managed only) under Debugging > General"):

Ignore exceptions that cross AppDomains when debugging in Visual Studio 2010

Community
  • 1
  • 1
Eric Bole-Feysot
  • 13,949
  • 7
  • 47
  • 53
5

Of course, there is a "restore defaults" option that does affect a large number of settings (including some debug settings).

If you haven't tried it yet, use the "Reset all settings" option in the "Import and Export settings..." wizard, accessed from the Tools menu. It prompts to save your current settings before it does the reset.

If this does resolve your problem, and you're still curious to know what you changed, you can then save your settings again using the same wizard, and perform a diff between the two files.

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
  • Got in trouble with this too... Reset is good, but it resets everything (my ReSharper stuff too, for example). A bit of a sledgehammer... This could be used too: http://blogs.msdn.com/b/zainnab/archive/2010/12/01/the-exceptions-dialog-vstipdebug0039.aspx – AlexeiOst Apr 17 '12 at 14:55