The breakpoint will not currently be hit. No symbo

2019-02-12 14:15发布

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.

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.

enter image description here

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

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.

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?

Need : Could anyone explain me the same answer in easier term (with more explanation).

9条回答
我只想做你的唯一
2楼-- · 2019-02-12 14:44

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):

enter image description here

But breakpoints in external *.js files will get hit:

enter image description here

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-12 14:48

This results for me:

In your web application make sure Silverlight and ASP.NET debugger are enabled.

How to get there?

=> Right click on the Web Application => Properties => Web tab. Under Debuggers section make sure Silverlight and ASP.NET are enabled.

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-02-12 14:48

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

查看更多
趁早两清
5楼-- · 2019-02-12 14:48

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 ):

In Project Property Pages, under Start Options, in Debugger section, only ASP.NET was enabled. As soon as I enabled Native Code and SQL Server, that red circle with plus sign inside, enabled again. No idea why this worked! No active connection in Server Explorer nor using any native code in the project!

查看更多
Animai°情兽
6楼-- · 2019-02-12 14:49

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.

查看更多
欢心
7楼-- · 2019-02-12 14:51

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:

  1. 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".)

  2. 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.

查看更多
登录 后发表回答