14

Since the entire team has upgraded to Visual Studio 2015, the debugger no longer breaks on unhandled exceptions in JavaScript. However 1 of the 4 machines works fine and we're guessing this is because it's on IE10 and the rest of us are on IE11.

Anyway, to cover the obvious stuff:

  • All settings are identical between all machines, including the mycode.default.wwa.json in the JavaScript > JustMyCode folder in the Visual Studio 2015 installation directory

  • The default settings on the new Exception Settings window match the Exception settings in the old modal window from 2012

So to reproduce the problem, we just write any old bit of dodgy code in an external JS file (note that script blocks on the page itself are caught correctly):

ViewModel.js:

function something() {
   foo();
}
something();

When JustMyCode is enabled, foo() will not be caught as an unhandled exception by the debugger. As soon as JustMyCode is disabled, the exception will be caught fine. So yeah, we can workaround this problem, but as soon as that's disabled, we lose actual .Net debugging.

Has anyone experienced this problem and/or found a solution? I've tried adding *.js to the MyCode section inside of the mycode.default.wwa.json file and I've also logged a bug on Connect, but I don't expect a fast answer from Microsoft on the matter.

Edit: So this only seems to happen when there's a query string on the end of the JS file, e.g. site.js?V=1234. If you remove the query string then the debugger catches exceptions as it did in Visual Studio 2012. Submitted a new repro and demo project to Microsoft.

djdd87
  • 67,346
  • 27
  • 156
  • 195

1 Answers1

0

I came across this, and in my case, it was related to domain names in my project settings. The fix was to make sure that the domain of the URL in IE is the same as the domain in the Project Settings/Web/Startup URL.

For example:

URL IN IE: http://www.yourproject.local

Startup URL in project settings: http://www.yourproject.local

If the two domains are different then Visual Studio handling of JavaScript exceptions is broken.

EDIT: I just saw your edit about query strings. So this may be related to your problem. Can you make sure domain names aren't mismatched?

Community
  • 1
  • 1
Josh Mouch
  • 3,480
  • 1
  • 37
  • 34