简体   繁体   English

断点当前不会被击中。 没有加载任何符号

[英]The breakpoint will not currently be hit. No symbols have been loaded

I am struggling with breakPoint issue in VS 2012 for more than hours. 我正在努力解决VS 2012中的breakPoint问题超过几个小时。 I am from eclipse background, there I never heard about such issues. 我来自日食背景,我从未听说过这样的问题。

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 . 我已将断点放在Jquery click操作中。

在此输入图像描述

I found the issue using the IE script debugging., The file loaded was old file., ie I have modified a lot, but I can see no changes in the one which is loaded in IE. 我发现使用IE脚本调试的问题。,加载的文件是旧文件。,即我已经修改了很多,但我可以看到在IE中加载的那个没有变化。 How to fix the bug 如何修复bug

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. 我知道这个问题是重复的,但作为VS和C#新手 ,我无法理解旧的答案。 For example, in this answer, he told to choose Debug -> Windows -> Modules. 例如, 在这个答案中,他告诉选择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 2012中没有Windows下的模块。即使我读过,我也无法理解这个解释。

Also I am quite new to term Assemblies and PDB . 我对术语AssembliesPDB也很PDB Though, I located PDB files as he said. 虽然,我说他找到了PDB文件。 But how to open the .pdb file? 但是如何打开.pdb文件?

Need : Could anyone explain me the same answer in easier term (with more explanation). 需要:任何人都可以用更简单的术语向我解释相同的答案(有更多解释)。

Try to add debugger; 尝试添加debugger; key word before $.getJSON Also make sure if you use IE to un-check the disable script debugging $.getJSON之前的$.getJSON还要确保使用IE取消检查禁用脚本调试

Internet Options> Advanced tab> Under Browsing. Internet选项>高级选项卡>在浏览下。

As I think this issue is related to Javascript debugging not C# 我认为这个问题与Javascript调试有关而不是C#

This results for me: 这导致我:

In your web application make sure Silverlight and ASP.NET debugger are enabled . 在Web应用程序中,确保已启用 SilverlightASP.NET调试程序。

How to get there? 如何到那?

=> Right click on the Web Application => Properties => Web tab. =>右键单击Web Application => Properties => Web选项卡。 Under Debuggers section make sure Silverlight and ASP.NET are enabled . 在“调试器”部分下,确保已启用 SilverlightASP.NET

I found this out by accident with my VS2012 and ASP.NET MVC, maybe it can help somebody. 我偶然发现了我的VS2012和ASP.NET MVC,也许它可以帮助某人。 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): 我注意到在这样的* .cshtml文件中内嵌的javascript中的断点不会被命中(注意这个文件是一个cshtml文件):

在此输入图像描述

But breakpoints in external *.js files will get hit: 但是外部* .js文件中的断点会受到影响:

在此输入图像描述

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文件中使用断点,我需要做两件事:

  1. I need to start Visual Studio by right-clicking the VS shortcut and select "Run as administrator". 我需要通过右键单击VS快捷方式启动Visual Studio,然后选择“以管理员身份运行”。 (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".) (如果右键单击任务栏图标,请从弹出菜单中选择应用程序快捷方式图标,然后右键单击该图标以获取包含“以管理员身份运行”的上下文菜单。)

  2. I need to set Internet Explorer as the default browser that will be opened for the web debugging session. 我需要将Internet Explorer设置为将为Web调试会话打开的默认浏览器。 If I choose Chrome or Firefox, the breakpoint doesn't work for me. 如果我选择Chrome或Firefox,断点对我来说不起作用。

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 Debugger section, only ASP.NET was enabled. 在“项目属性页 ”的“ 启动选项”下的“ 调试器”部分中,仅启用了ASP.NET As soon as I enabled Native Code and SQL Server , that red circle with plus sign inside, enabled again. 只要我启用了本机代码SQL Server ,就会再次启用带有加号的红色圆圈。 No idea why this worked! 不知道为什么这个有效! No active connection in Server Explorer nor using any native code in the project! Server Explorer中没有活动连接,也没有在项目中使用任何本机代码!

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. 您可以在调试时按Ctrl + D,M组合。 In few words, PDB is a file that contains all debug information about your assebmly, you can not debug an assembly without this file. 简而言之,PDB是一个包含有关你的assebmly的所有调试信息的文件,你不能在没有这个文件的情况下调试程序集。 Assembly is a file that contains precompiled code for exetuion via CLR. Assembly是一个文件,包含通过CLR进行exetuion的预编译代码。 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 此外,如果您找到了适合您的程序集的pdb文件,则可以通过右键单击模块窗口中的程序集并选择Load Symbol From> Symbol Path来加载它。

尝试删除所有断点并在Visual Studio中重新启动调试。

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. 当您设置VS以启动浏览器(在我的情况下为Chrome)时,它会打开一个新的Chrome窗口。 I was trying to debug the specific code (different URL from the window that opened) in a new tab. 我试图在新选项卡中调试特定代码(打开的窗口中的不同URL)。 So I had the 'The breakpoint will not currently be hit. 所以我得到了'断点当前不会被击中。 Breakpoint set but not yet bound' in VS. 断点设置但尚未绑定在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. 似乎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

As this is Javascript code, so you need to use a javascript debugger. 由于这是Javascript代码,因此您需要使用javascript调试器。 Generally internet browsers come with a debugger/inspector menu, which allows you to inspect/debug your javascript easily. 通常,互联网浏览器附带调试器/检查器菜单,允许您轻松检查/调试您的JavaScript。 Such debuggers come with a lot of useful features such as HTTP request/response inspection, browser session/local storage, etc. 此类调试器具有许多有用的功能,如HTTP请求/响应检查,浏览器会话/本地存储等。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 断点当前不会被命中。 没有在JavaScript中为此文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in JavaScript 断点当前不会被命中。 与2013 javascript相比,此文档未加载任何符号 - the breakpoint will not currently be hit. no symbols have been loaded for this document vs 2013 javascript 断点当前不会被命中。 Windows Phone 8.1 phonegap应用程序中没有为该文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in Windows Phone 8.1 phonegap apps 断点当前不会被击中。已调试的进程已加载不同版本的脚本文件 - The breakpoint will not currently be hit. A different version of script file has been loaded by debugged process 由于未加载符号,断点未命中 - Breakpoint not getting hit due to symbols not been loaded 命中断点时,Sourcemap请求挂起。 有没有办法强制预加载? - Sourcemap request pending when breakpoint is hit. Is there a way to force a preload? TypeScript 调试错误 - 当前未命中断点 - 使用特殊字符时 - TypeScript debug error - the breakpoint not currently be hit - when use special character 当我有条件 `if (bool = true)` 时,永远不会命中 else 分支。 为什么? - When I have a condition `if (bool = true)`, the else branch is never hit. Why? 没有为此文档加载任何符号。 无法在 Visual Studio Code 中调试 Javascript - No symbols have been loaded for this document. Can't debug Javascript in Visual Studio Code 我的启动项目中的JS文件出现另一个“断点当前不会被击中”错误 - Yet Another 'The Breakpoint will not currently be hit' error for a JS file in my startup project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM