无法加载符号文件以在Visual Studio 2012中调试自定义项目 [英] Symbol file not loading for debugging custom project in Visual Studio 2012

查看:265
本文介绍了无法加载符号文件以在Visual Studio 2012中调试自定义项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2012中有一个大型解决方案,它由可执行文件和类库项目组成. 在调试应用程序时,不会碰到一个特定类库项目中的断点.

I have a large solution in Visual Studio 2012 which consists of executables and class library projects. When debugging the application the breakpoints in one particular class library project are not being hit.

我查看了 Debug> Windows> Modules 窗口,以检查该项目的符号状态,并显示无法找到或打开PDB文件" .
它还在用户代码" 列下显示否" .
我注意到解决方案中还有一些其他自定义项目在该列中显示否",并且它们的符号也无法加载.任何在用户代码"下带有是"的东西似乎都已经将其pdb加载了.但是我不确定这是否相关.

I looked at the Debug> Windows> Modules window to check the status of the symbols for that project and it says "Cannot find or open the PDB file".
It also says "No" under the "User Code" column.
I notice that there are a few other of the custom projects in the solution that are showing "No" in that column and their symbols are also failing to load. Anything with a "Yes" under "User code" seems to have had it's pdb loaded no problem. But I'm not sure if this is relevant.

我在dll上使用了 dumpbin/headers ,并且pdb文件的路径存在且正确.

I have used dumpbin /headers on the dll and the path for the pdb file is present and correct.

该模块绝对不在符号加载的排除列表中.

The module is definitely not in the exclude list for the symbol loading.

我还尝试右键单击模块窗口中的条目,选择加载符号" ,然后导航至dll标头中给出的路径.当我选择pdb时,它会显示在此文件夹中找不到匹配的符号文件" .

I have also tried right clicking on the entry in the modules window, selecting "Load symbols" and navigating to the path given in the dll header. When I select the pdb it says "A matching symbol file was not found in this folder".

在删除这些文件夹和文件,清理解决方案,将其关闭并重新构建整个东西之后,我得到了此信息. pdb肯定是与所讨论的dll同时构建的.

I get this after I have deleted these folders and files, cleaned the solution, closed it and rebuilt the whole thing. The pdb was definitely built at the same time as the dll in question.

很明显,问题出在错误消息的无法打开pdb"部分.

So clearly the problem is the "cannot open the pdb" portion of the error message.

我已经在两台计算机上进行了尝试,并且两者都表现出相同的行为.

I have tried this on 2 computers and both are exhibiting the same behaviour.

任何人都可以提供有关从此处去哪里的任何建议,也许为什么地球上与dll相对应的已构建pdb无法加载?

Can anyone offer any suggestions on where to go from here, and perhaps why on earth the built pdb corresponding to the dll won't load for it?

推荐答案

我尝试了一些工具来检查pdb和dll是否真正匹配,并使用

I tried a few tools to check if the pdb and the dll actually matched, and using chkmatch I could see that the GUIDs in the dll being run and the pdb in the obj folder didn't match.

因此,事实证明,尽管项目的obj文件夹中的dll和pdb是匹配的,但实际上通过生成后事件复制到应用程序目标文件夹中的dll是上一生成中的旧dll.

So it turns out that although the dll and pdb in the project's obj folder are a match, the dll that was actually getting copied to the application's destination folder by a post-build event was the old dll from the previous build.

构建后事件在该特定项目已构建或至少已完成构建之前运行,并且正在从bin中复制现有dll,随后被继续构建覆盖.

The post-build event was running before that particular project had built, or at least finished building, and was copying in the existing dll from the bin which was subsequently overwritten by the continuing build.

我已经解决了问题,方法是编辑解决方案的项目依赖项,并确保带有构建后事件的项目依赖于未加载的项目,现在pdb在调试期间加载了.

I have resolved the problem by editing the project dependencies for the solution and ensuring that the project with the post-build event is dependent on the project that wasn't loading, and now the pdb loads during debug.

这篇关于无法加载符号文件以在Visual Studio 2012中调试自定义项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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