“No symbols loaded for the current document” while

2019-06-14 21:31发布

I'm working on a .NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a breakpoint in any of the .js files I get a warning that says:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

How do I fix this? I'm guessing that Visual Studio is having some trouble parsing through some of the jQuery code. I will try to replace the minimized version of jQuery.js with the expanded version, but I don't think that will fix it.

14条回答
女痞
2楼-- · 2019-06-14 22:01

I had the same annoying issues on Visual Studio 2013, and JavaScript development without a debugger is just suicide.

All I did to fix it was to right click the break point red dot -> Disable Breakpoint and then right click again -> Enable Breakpoint.

This made the debugger work on JavaScript like a charm again.

查看更多
爷、活的狠高调
3楼-- · 2019-06-14 22:02

This is perhaps glaringly obvious, but I stumbled over this for a second, so perhaps others will too. I didn't have Internet Explorer set up to handle HTML/HTTP, and hence it was not launched when I pressed the run button in Visual Studio.

Instead, I was starting Firefox. I went to Start Button | Default Programs, set all the defaults for Internet Explorer, and then debugging started working in Visual Studio for me without any other fuss.

查看更多
甜甜的少女心
4楼-- · 2019-06-14 22:04

All of these answers are correct, but there is one more thing to check. Until yesterday I was always able to debug my JavaScript code from inside of Visual Studio (2012). I had added a Silverlight project to the solution, which turned on the Silverlight Debugger. This was my problem.

On the property page for the web application -> Start Options -> at the bottom of the page be sure that "Silverlight" is unchecked. Actually, I have only ASP.NET checked and now the debugger goes through Visual Studio.

Unchecking it and now the debugger stops on the "initialize" function as I wanted.

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-06-14 22:07

You have to wait for the IDE to parse the JavaScript code. Just wait a while and you should see the JavaScript code change color. You will then be able to add breakpoints.

查看更多
Deceive 欺骗
6楼-- · 2019-06-14 22:09

I sometimes have this problem with external JavaScript files - it is caused by the browser cache holding onto an old copy of the file. Forcing a refresh of the page linking to the JavaScript code solves the issue in this case.

Of course, make sure your debugger is attached to the correct browser process. ;)

查看更多
我想做一个坏孩纸
7楼-- · 2019-06-14 22:11

I would suggest using FireBug for JavaScript debugging. Give it a spin :)

查看更多
登录 后发表回答