javascript 当前不会命中断点。未加载任何符号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16936209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The breakpoint will not currently be hit. No symbols have been loaded
提问by Muthu Ganapathy Nathan
I am struggling with breakPoint issue in VS 2012 for more than hours. I am from eclipse background, there I never heard about such issues.
我在 VS 2012 中为 breakPoint 问题苦苦挣扎了几个小时。我来自日食背景,我从未听说过此类问题。
Problem :
问题 :
The breakpoint will not currently be hit. No symbols have been loaded for this document.
当前不会命中断点。尚未为此文档加载任何符号。
I have placed the break point in click
action of Jquery
.
我把破发点,click
的行动Jquery
。
I found the issue using the IE script debugging., The file loaded was old file., i.e I have modified a lot, but I can see no changes in the one which is loaded in IE. How to fix the bug
我用IE脚本调试发现问题。,加载的文件是旧文件。,即我修改了很多,但我看不到IE加载的一个没有变化。如何修复错误
What I have Tried :
我试过的:
I know this question is duplicate, but being a newbie to VS and C#., I could not understand the older answers. For example, in this answer,he told to choose Debug -> Windows -> Modules. But I doesn't have Modules under windows in VS 2012. Also even though I read, I could not understand the explanation.
我知道这个问题是重复的,但作为VS 和 C#的新手,我无法理解旧的答案。例如,在这个答案中,他告诉选择 Debug -> Windows -> Modules。但是我在 VS 2012 中没有 windows 下的模块。另外,即使我阅读了,我也无法理解解释。
Also I am quite new to term Assemblies
and PDB
. Though, I located PDB files as he said. But how to open the .pdb file?
此外,我对 termAssemblies
和PDB
. 不过,我如他所说的那样找到了 PDB 文件。但是如何打开 .pdb 文件呢?
Need :Could anyone explain me the same answer in easier term (with more explanation).
需要:任何人都可以用更简单的术语向我解释相同的答案(更多解释)。
回答by AshOoO
Try to add debugger;
key word before $.getJSON
Also make sure if you use IE to un-check the disable script debugging
尝试在debugger;
之前添加关键字$.getJSON
还要确保您是否使用 IE 取消选中禁用脚本调试
Internet Options> Advanced tab> Under Browsing.
Internet 选项 > 高级选项卡 > 在浏览下。
As I think this issue is related to Javascript debugging not C#
因为我认为这个问题与 Javascript 调试有关,而不是 C#
回答by armee
This results for me:
这对我来说结果:
In your web application make sure Silverlightand ASP.NETdebugger are enabled.
在您的 Web 应用程序中,确保启用Silverlight和ASP.NET调试器。
How to get there?
到那里怎么走?
=> Right click on the Web Application => Properties => Web tab. Under Debuggers section make sure Silverlightand ASP.NETare enabled.
=> 右键单击 Web 应用程序 => 属性 => Web 选项卡。在调试部分中,确保的Silverlight和ASP.NET被启用。
回答by James Toomey
I found this out by accident with my VS2012 and ASP.NET MVC, maybe it can help somebody. I noticed that breakpoints in javascript that's inline in the *.cshtml file like this won't get hit (note that this file is a cshtml file):
我在我的 VS2012 和 ASP.NET MVC 中偶然发现了这一点,也许它可以帮助某人。我注意到像这样内嵌在 *.cshtml 文件中的 javascript 中的断点不会被命中(注意这个文件是一个 cshtml 文件):
But breakpoints in external *.js files will get hit:
但是外部 *.js 文件中的断点会被命中:
回答by StackOverflowUser
Running Visual Studio 2013 or Visual Studio 2015 RC, I've found that to get a breakpoint to work in a .js file I need two things to be true:
运行 Visual Studio 2013 或 Visual Studio 2015 RC,我发现要让断点在 .js 文件中工作,我需要做两件事:
I need to start Visual Studio by right-clicking the VS shortcut and select "Run as administrator". (If right-clicking on the Taskbar icon, select the application shortcut icon from the pop-up menu and right-click on that to get a context menu that includes "Run as administrator".)
I need to set Internet Explorer as the default browser that will be opened for the web debugging session. If I choose Chrome or Firefox, the breakpoint doesn't work for me.
我需要通过右键单击 VS 快捷方式并选择“以管理员身份运行”来启动 Visual Studio。(如果右键单击任务栏图标,请从弹出菜单中选择应用程序快捷方式图标,然后右键单击该图标以获取包含“以管理员身份运行”的上下文菜单。)
我需要将 Internet Explorer 设置为将为 Web 调试会话打开的默认浏览器。如果我选择 Chrome 或 Firefox,断点对我不起作用。
回答by Behzad Sedighzadeh
After opening and closing VS, rebooting the PC with all with no chance, this workaround worked for me in VS 2012 ( Ver 11.0.50727.1 RTMREL ):
打开和关闭 VS 后,毫无机会地重新启动 PC,此解决方法在 VS 2012(Ver 11.0.50727.1 RTMREL)中对我有用:
In Project Property Pages, under Start Options, in Debuggersection, only ASP.NETwas enabled. As soon as I enabled Native Codeand SQL Server, that red circle with plus sign inside, enabled again. No idea why this worked! No active connection in Server Explorernor using any native code in the project!
在项目属性页,在启动选项,在调试节,仅ASP.NET已启用。一旦我启用了Native Code和SQL Server,里面带有加号的红色圆圈再次启用。不知道为什么这有效!服务器资源管理器中没有活动连接,也没有在项目中使用任何本机代码!
回答by Christopher Posada
I had the same problem. You can use VS2017 to debug JS code this way.
我有同样的问题。可以用VS2017这种方式调试JS代码。
When you set VS to launch the browser (Chrome in my case), it opens a new Chrome window. I was trying to debug the specific code (different URL from the window that opened) in a new tab. So I had the 'The breakpoint will not currently be hit. Breakpoint set but not yet bound' in VS.
当您将 VS 设置为启动浏览器(在我的例子中是 Chrome)时,它会打开一个新的 Chrome 窗口。我试图在新选项卡中调试特定代码(与打开的窗口不同的 URL)。所以我有'断点目前不会被击中。在 VS 中设置了断点但尚未绑定'。
I found out that if I opened the new URL in the original tab it suddenly worked. Seems that VS is tied to that particular tab.
我发现如果我在原始选项卡中打开新 URL,它会突然起作用。似乎 VS 与该特定选项卡相关联。
Hope this helps.
希望这可以帮助。
These are the particulars of my situation: VS 2017 - Mainly C# code with some embedded HTML/JS which I needed to debug, Chrome (Version 68.0.3440), Windows 10
这些是我的情况的细节:VS 2017 - 主要是 C# 代码,我需要调试一些嵌入式 HTML/JS,Chrome(版本 68.0.3440),Windows 10
回答by Juned Ahsan
As this is Javascript code, so you need to use a javascript debugger. Generally internet browsers come with a debugger/inspector menu, which allows you to inspect/debug your javascript easily. Such debuggers come with a lot of useful features such as HTTP request/response inspection, browser session/local storage, etc.
由于这是 Javascript 代码,因此您需要使用 javascript 调试器。通常 Internet 浏览器带有调试器/检查器菜单,它允许您轻松检查/调试您的 javascript。此类调试器带有许多有用的功能,例如 HTTP 请求/响应检查、浏览器会话/本地存储等。
回答by Alexey.Efimov
Actually there is "Modules" option, but it's enabled only when you are in debug mode. You can just press Ctrl+D,M combination when you're in debug. In few words, PDB is a file that contains all debug information about your assebmly, you can not debug an assembly without this file. Assembly is a file that contains precompiled code for exetuion via CLR. Could you provide a bit more information about your problem. What kind of application you are trying to debug for example? Also, if you have located you pdb files made EXACTLY for your assembly, you can load it by right-clicking your assembly in modules window and selecting Load Symbols From > Symbol Path
实际上有“模块”选项,但只有在调试模式下才启用它。您可以在调试时按 Ctrl+D,M 组合键。简而言之,PDB 是一个包含有关您的程序集的所有调试信息的文件,如果没有此文件,您将无法调试程序集。程序集是一个文件,其中包含用于通过 CLR 执行的预编译代码。您能否提供有关您的问题的更多信息。例如,您要调试什么样的应用程序?此外,如果您找到了完全为您的程序集制作的 pdb 文件,您可以通过在模块窗口中右键单击您的程序集并选择加载符号自> 符号路径来加载它
回答by thecoolmacdude
Try deleting all breakpoints and restarting debugging in Visual Studio.
尝试删除所有断点并在 Visual Studio 中重新启动调试。