I've run into some bizarre problem debugging
JS; on a random basis the VS IDE refuses to recognize breakpoints. This is apparently a known bug MS has promised to eventually fix, but this won't wait for them to get around to it. Others have suggested adding a "debugger;" statement, but like breakpoints, this also only works sometimes; VS asks which version of VS I want to open (2008, 2010 and 2012 are all installed), but the script is sometimes not displayed. Clicking on the documents listed in Solution Explorer appears to do nothing. That's clearly no help debugging!
But when VS hits some
JS errors, it opens a different dialog box asking if I wish to use the built-in script debugger in IE. When I answer yes, the script is displayed in the F12 Developer Tools debugger and I can step through it as expected. I could obviously force an error to invoke the F12 tool, but that's as clunky as adding a "debugger" statement and may mask the real problem.
And inserting "alerts" before every statement to trace it (like the dark ages before interactive debuggers) doesn't help when the script refuses to run at all!
Has anybody else also experienced this? Is there some setting that would redirect VS to the F12 tool when it hits the debugger statement instead of opening an empty instance of VS? If there is no way to do that, what do I have to do to get the script to actually appear when it hits this "debugger" statement?
How do I debug this script?