Eric
Eric

Reputation: 3241

IE11 F12 debugger not attaching

I've added a debugger statement to some JavaScript that's executed on page load on page B. I've opened page A, opened the F12 debugger tools. I have "Break on all exceptions" enabled in the F12 debugger tools.

I've then clicked on the link that opens page B. I'm then shown a dialog asking me if I want to debug with Visual Studio 2010 or Visual Studio 2012. Why didn't it just open the JavaScript in the F12 debugger tools?

To make it even weirder, if I close the F12 developer tools and click the link for page B I don't even get the dialog asking me if I want to debug with VS 2010 or VS 2012.

-Eric

Upvotes: 1

Views: 1494

Answers (1)

Andy Sterland
Andy Sterland

Reputation: 1936

The dialog you're seeing is the "Just in Time" debugger dialog. It is shown on two conditions:

  1. The page is in debug mode - In this scenario that is likely happening because the page A is in debug mode and page B has inherited that setting (it most likely is in the same process and the setting is per process). If F12 isn't open then the page won't be in debug mode (unless configured elsewhere) and thus the debugger keyword will be ignored.
  2. The page encounters a reason to break (e.g. the debugger keyword or an unhandled exception) - In this case it's the debugger keyword

IE was designed this way to allow other debuggers, such as Visual Studio, to attach an debug IE rather than restricting it to just the F12 tools. As you have Visual Studio installed you are seeing the dialog that Visual Studio installs (You can read more on msdn).

The easiest solution would be to launch F12 on page b and it should work. Unfortunatley as you need to debug startup code you'll need to refresh page b in order to run that code as F12 can't be open before. That assumes you can refresh page b. If not it's a bit trickier but there should be a way. (Just let me know!)

Upvotes: 1

Related Questions