使用vs的时候,遇到这个:当前不会命中断点 还没有为该文档加载任何符号

http://stackoverflow.com/questions/2155930/fixing-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-fo

unable to hit the breakpoint

 

Start debugging, as soon as you've arrived at a breakpoint or used Debug > Break All, use Debug > Windows > Modules.

You'll see a list of all the assemblies that are loaded into the process.

Locate the one you want to get debug info for.

Right-click it and select Symbol Load Information.

You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly.

Verify that list against the actual .pdb location.

Make sure it doesn't find an old one.

In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe.

The bin\Debug folder of your project.

Make sure you remove one from the GAC if you've been playing with it.

 

需要去确认下项目的生成路径,清空路径下的pdb文件。

清理解决方案的时候,有可能没有清理干净。

 

项目处于Release模式下。需要改为Debug模式。

 

 

三  website

在资源监视器中搜索,App_Web_lisamemberforgotpassword.ascx.723932e,找到文件路径,然后删除对应的pdb文件 和dll文件

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_43_dev_cmsweb\7939be6a\8be1af30\App_Web_lisamemberforgotpassword.ascx.723932e.bbztc3fx.pdb

1.website临时文件夹中的pdb和dll文件,删除后,会自动根据临时文件夹中的cs文件生成新的。

 2.website临时文件夹中的cs文件删除后,会自动重新生成cs和dll文件

 删除文件的之前,要把网页的访问关闭,最后停止vs的debug,iis中的线程池可以不停止。

 

最后发现是cmsdesk中配置的访问界面指向了另外一个位置。

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_43_dev_cmsweb\7939be6a\8be1af30\App_Web_lisamemberforgotpassword.ascx.723932e.fho6ik0c.1.cs

#pragma checksum "D:\ChuckLu\GitForSvn\Lisa4.3\LISA.CMSWeb\LISA.CMSWeb\CMSWebParts\LISA\NoUse\Member\LISAMemberForgotPassword.ascx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FCFB551D12F4A236BAF470CFB7F010AE81376590"

#line 1 "D:\ChuckLu\GitForSvn\Lisa4.3\LISA.CMSWeb\LISA.CMSWeb\CMSWebParts\LISA\NoUse\Member\LISAMemberForgotPassword.ascx.cs"

 

 

源代码与原始版本不同

主要原因是,从其他地方直接复制了代码,导致的

 

代码不要直接复制,自己手打就是 了

 

 

从别处复制粘贴代码后可能会引起这种情况发生,因为你向代码文件里粘贴了ANSI格式不兼容的字符,影响了编译器变更检查功能。

解决方法:把你的代码另存为一份,另存为时选择Unicode编码格式,用另存为的Unicode格式代码文件替换原来那份代码文件,打断点调试的功能就能正常使用了。

 

没有与此行关联的可执行代码

我遇到的情况是:设置启动项目

一个解决方案中有多个项目,其中有两个项目有main函数。需要设置启动项目的。

之前将A项目设置为启动项目,后来改为B项目是启动项目。

但是后来想调试A项目的时候,忘记重新将A项目设定为启动项目。

所以A项目中的断点就会提示

 

http://stackoverflow.com/questions/2155930/fixing-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-fo

In my situation, the Visual Studio loads the DLLs in Global Assembly Cache (GAC), not the DLL in my project list.

I deleted the DLLs in GAC and now I can see the break point working.

 

 

有可能是,设置断点的地方,本来就不会被执行。比如A页面的代码操作,断点错误地设置了在B页面,并且B页面都没有加载过。

 

posted @ 2014-12-05 10:28  ChuckLu  阅读(1184)  评论(0编辑  收藏  举报