Cannot hit breakpoint inside .js file

I upgraded to win 8. Now I run VS 2012 as administrator and I create a website in MVC 4. I tested various solutions on the Internet and none of them worked. I have a javascript file in my solution, but when I put a breakpoint in it, at runtime I see that "no characters were loaded for this document." I had this problem a couple of years ago with VS 2008 and for some reason it was resolved. I don’t remember that I changed anything at all. Now he's back! except that I did not win XP and VS 2008. the .pdb files are in place (bin \ Debug), the script debugging is enabled in the Internet settings, and I can debug my C # code without any problems. completely the same situation in which I returned in 2008. Whatever it is, it's all about javascript, as it happens for inline JavaScript too!

the weird part is that the js code is running, but I just can't debug it in vs 2012.

I already know a workaround that uses f12 tools or something similar. This is not so, I had VS 2012 scoring 7 two weeks ago, and I was debugging my js in VS without any problems. this is the same installation, so it should be connected with win 8.

So how can I solve this?

+6
source share
5 answers

Disable user account management settings

If this does not work, create a new application (do not change anything!). Make sure JavaScript debugging is enabled in Internet Explorer.

If this does not work, make sure that JavaScript is enabled in the current Internet security zone (IE settings).

+9
source

You can use the debugger to hit your code. Just write

debugger; 

before the line you want to debug, and that will work. I think it will make your life easy.

+14
source

Using Visual Studio 2015, I found that breakpoints will only work when you start your project in Internet Explorer.

It will not work for Firefox or Chrome.

For Firefox, you can use Firebug (the Firefox plugin) to debug JavaScript, as shown below:

enter image description here

+3
source

One thing to check is the property pages of your project to make sure your debugger type is Script Only . Just right-click the project in Solution Explorer and check the Debug page.

enter image description here

+2
source

Try setting a breakpoint in the very first instruction of your JavaScript file, your breakpoint is probably in the code that is not reached.

+1
source

All Articles