“没有为当前文档加载的符号”同时在Visual Studio中调试JavaScript [英] "No symbols loaded for the current document" while debugging JavaScript in Visual Studio

查看:95
本文介绍了“没有为当前文档加载的符号”同时在Visual Studio中调试JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个.NET 3.5网站上工作,三个项目在一个解决方案之下。我在这个项目中使用jQuery。我想使用Visual Studio JavaScript调试器来浏览我的JavaScript代码。如果我在任何.js文件中设置了一个断点,我会收到一条警告:


断点现在不会被打。没有为此文档加载任何符号。


我该如何解决?我猜测Visual Studio在解析一些jQuery代码方面有一些麻烦。我将尝试用扩展版本替换 jQuery.js 的最小化版本,但我不认为这会解决它。

解决方案

我在Visual Studio 2008中遇到了同样的行为,花了几分钟时间尝试加载符号,最终使用了解决方法 - 添加了一行调试器命令在我的JavaScript文件。



添加调试器; 当您在Internet Explorer中重新加载脚本时,让你提出一个脚本调试器的新实例,它将停止在你的调试器命令中,让你从那里进行调试。



在这种情况下,我已经在调试 Firebug 中的JavaScript,但我也想对Internet Explorer进行调试。


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.

解决方案

I was experiencing the same behavior in Visual Studio 2008, and after spending several minutes trying to get the symbols to load I ended up using a workaround - adding a line with the "debugger;" command in my JavaScript file.

After adding debugger; when you then reload the script in Internet Explorer it'll let you bring up a new instance of the script debugger, and it'll stop on your debugger command let you debug from there.

In this scenario I was already debugging the JavaScript in Firebug, but I wanted to debug against Internet Explorer as well.

这篇关于“没有为当前文档加载的符号”同时在Visual Studio中调试JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆