.net Visual Studio 2010 断点未加载任何符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7734246/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 15:57:03  来源:igfitidea点击:

visual studio 2010 breakpoint no symbols have been loaded

.netvisual-studio-2010debuggingc#-4.0

提问by franko_camron

I really have a problem, I have a VS 2010 solution and it suddenly stopped debugging for referenced projects, I just can debug the start up project but not the added as reference. This is weird because I created a new solution, added two projects and then I debugged in both successfully, did that in order to see if my VS config was wrong, but nop, It's something on this particular solution that is not allowing me to debug referenced projects.

我真的有问题,我有一个 VS 2010 解决方案,它突然停止了对引用项目的调试,我只能调试启动项目,但不能调试作为参考添加的项目。这很奇怪,因为我创建了一个新解决方案,添加了两个项目,然后我成功地调试了两个项目,这样做是为了查看我的 VS 配置是否错误,但是不,这个特定解决方案上的某些内容不允许我进行调试参考项目。

I've read all possible solutions from this forum and other sources like Microsoft. If I go to menu Debug -> windows -> Modules the ones I want to debug are not in the list. screen 1 my running modules

我已经从这个论坛和微软等其他来源阅读了所有可能的解决方案。如果我转到菜单 Debug -> windows -> Modules 我想要调试的不在列表中。屏幕 1 我正在运行的模块

so, I read a Microsoft's page saying how to manually load symbols, I did the following:

所以,我读了一个微软的页面,说如何手动加载符号,我做了以下事情:

To specify a directory where symbol files are located

On the Tools menu, choose Options.

In the Options dialog box, open the Debugging node and then click Symbols.

On the Symbols page, there is a box that states Symbol file (.pdb) locations. Above the box are four icons.

Click the folder icon.

Editable text appears in the Symbol file (.pdb) locations box.

Type the directory path. Statement completion helps you find the correct format.

If you are doing remote debugging, symbol files and symbol server caches for managed code must be located on the remote computer. Symbol files and symbol server caches for native code must be located on the local computer.

If you are using symbols on a remote symbol server, you can improve performance by specifying a local directory that symbols can be copied to. To do this, type a path in the Cache symbols in this directory box. If you are debugging a program on a remote computer, the cache directory refers to the directory on the remote computer.

Click OK.

指定符号文件所在的目录

在工具菜单上,选择选项。

在选项对话框中,打开调试节点,然后单击符号。

在符号页面上,有一个框指出符号文件 (.pdb) 的位置。框上方是四个图标。

单击文件夹图标。

可编辑文本出现在符号文件 (.pdb) 位置框中。

键入目录路径。语句完成可帮助您找到正确的格式。

如果您进行远程调试,托管代码的符号文件和符号服务器缓存必须位于远程计算机上。本机代码的符号文件和符号服务器缓存必须位于本地计算机上。

如果您在远程符号服务器上使用符号,则可以通过指定可以将符号复制到的本地目录来提高性能。为此,请在此目录中的缓存符号框中键入路径。如果在远程计算机上调试程序,则缓存目录是指远程计算机上的目录。

单击确定。

That didn't work, I still can't see the modules I want to load so.. any ideas my friends ?

那没用,我仍然看不到我想加载的模块,所以..朋友们有什么想法吗?

采纳答案by franko_camron

I solved, the answer might not be good I pretty sure but to tell the truth I had to uninstall and reinstall the application. Worked like a charm. I know, that takes a lot of time but I already spent time trying to solve the issue so ...

我解决了,我很确定答案可能不是很好,但说实话我不得不卸载并重新安装应用程序。像魅力一样工作。我知道,这需要很多时间,但我已经花时间试图解决这个问题,所以......

回答by Reese

One more thing to check, just to be clear: Make sure you have the configuration set to 'Debug' and not 'Release'. You can debug the startup project in 'Release' mode, but not a referenced class library.

还有一件事要检查,只是要清楚:确保将配置设置为“调试”而不是“发布”。您可以在“发布”模式下调试启动项目,但不能调试引用的类库。

回答by hege

The holy trinity in such cases: rebuild all, restart VS, restart computer.

在这种情况下的三位一体:重建所有,重新启动VS,重新启动计算机。

  • Rebuild all: making sure that everything is up-to-date. If it doesn't work:
  • Restart studio: in some cases, the debug symbol service gets stuck a won't refresh the loaded symbols with the newly compiled ones. In most of the cases restarting the VS will solve the problem. If not:
  • Restart computer: brute force but effective.
  • 全部重建:确保一切都是最新的。如果它不起作用:
  • 重新启动工作室:在某些情况下,调试符号服务卡住了,不会用新编译的符号刷新加载的符号。在大多数情况下,重新启动 VS 将解决问题。如果不:
  • 重新启动计算机:蛮力但有效。

Also, you should check if you're build emitting a debugable assembly.

此外,您应该检查您是否正在构建发出可调试的程序集。

回答by user2219436

I solved this like follows:

我解决了这个问题如下:

  • Go to Project Property Page.
  • On left hand side go to the Buildtab.
  • Search/Scroll down to for "Generate serialization assembly".
  • In front of this text there is "Advanced..."button: click it.
  • Make sure that you have Debug Info as full.
  • Click ok and you are done.
  • 转到项目属性页。
  • 在左侧,转到“构建”选项卡。
  • 搜索/向下滚动到“生成序列化程序集”
  • 在此文本前面有“高级...”按钮:单击它。
  • 确保您的 Debug Info 为full
  • 单击确定,您就完成了。

回答by John Cornell

This usually means that the assembly you're trying to debug is out of date (Your source is not the same as the one used to create the assembly). One of the problems I see a lot, is if the solution didn't build due to errors, but you didn't notice and end up debugging the last successful build. Make sure all projects are rebuilt, and successful.

这通常意味着您尝试调试的程序集已过期(您的源与用于创建程序集的源不同)。我经常看到的问题之一是,如果解决方案由于错误而没有构建,但您没有注意到并最终调试了最后一次成功构建。确保所有项目都重建并成功。

回答by Dashu

Might be that the solution configuration has gone haywire. Make sure that your using debug and that debug info is checked for the configuration

可能是解决方案配置出了问题。确保您使用调试并且检查了配置的调试信息

回答by user4642355

The idea of stopping and restarting VS 2010 worked for me for the same problem. However, I had to open a different and unrelated solution, close that one and reopen the solution with the debug symbols problem. All is now well. Hope this helps.

对于同样的问题,停止和重新启动 VS 2010 的想法对我有用。但是,我必须打开一个不同且不相关的解决方案,关闭该解决方案并重新打开带有调试符号问题的解决方案。现在一切都很好。希望这可以帮助。

回答by Dave

A bit late here but I just Googled a similar issue and I came straight here. I'm using VS2010(c++) and had a similar issue with a bug only seen in a Release build. My fix to get the symbols loaded was to ask VS2010 to create and load them :-)

这里有点晚了,但我只是在谷歌上搜索了一个类似的问题,然后我就直接来到了这里。我正在使用 VS2010(c++) 并且有一个类似的问题,即只有在发布版本中才能看到的错误。我加载符号的修复方法是要求 VS2010 创建和加载它们:-)

SolutionExplorer->ProjectName - Right click and select Properties. In the property page, at the top, confirm the correct configuration and platform that you are about to change the properties, for me I wanted Release and x64. Open up the Linker->Debugging, in the properties pane there is an option to 'Generate Debug Info' - change this to 'Yes'. Rebuild and the debug symbols are generated and loaded for debugging. You can selectively do this for each project in the solution.

SolutionExplorer->ProjectName - 右键单击​​并选择属性。在属性页的顶部,确认您将要更改属性的正确配置和平台,对我来说,我想要 Release 和 x64。打开链接器->调试,在属性窗格中有一个“生成调试信息”选项 - 将其更改为“是”。重建和调试符号生成并加载用于调试。您可以有选择地为解决方案中的每个项目执行此操作。

Hope it helps.

希望能帮助到你。

[EDIT] Be aware that due to optimisations and possible assembly code re-ordering that the values that not make sense in some situations.[/EDIT]

[编辑] 请注意,由于优化和可能的汇编代码重新排序,在某些情况下没有意义的值。[/编辑]

回答by Zee

I had this issue. I tried everything, rebuild all, restarting VS, restarting machine, etc. I finally figured it out, and the issue is extremely annoying. The debug dropdown, which contains "Debug", "Release" showed "Debug" the entire time I troubleshooted this issue. However, it appears that it was attempting in release. With it already set to Debug, I opened the dropdown menu, selected Debug, and then started again and symbols were loaded successfully. And again, this is after attempting to restart computer and everything. And visual studio loads with the dropdown defaulted to "Debug" yet I have to select it from the dropdown anyway. :@

我有这个问题。我什么都试过了,全部重建,重启VS,重启机器等等,终于搞定了,这个问题非常烦人。在我解决此问题的整个过程中,包含“调试”、“发布”的调试下拉列表都显示“调试”。但是,它似乎正在尝试发布。它已经设置为调试,我打开下拉菜单,选择调试,然后再次启动并成功加载符号。再次,这是在尝试重新启动计算机和一切之后。Visual Studio 加载时的下拉菜单默认为“调试”,但无论如何我都必须从下拉列表中选择它。:@

回答by dalemac

I just had this issue with VS2013.

我刚刚在 VS2013 上遇到了这个问题。

The project would build, but no symbol file would be shown in the modules panel.

项目将构建,但不会在模块面板中显示符号文件。

I ended copying the source code to another folder, then rolled back the project to a previous version via git, then copying over the source code only (no project, bin, obj, etc).

我结束将源代码复制到另一个文件夹,然后通过 git 将项目回滚到以前的版本,然后仅复制源代码(没有项目、bin、obj 等)。

Then cleaned and rebuilt and Viola, the symbols are back and i haven't lost any code.

然后清理并重建 Viola,符号又回来了,我没有丢失任何代码。

It must have corrupted the project file or something.

它一定是损坏了项目文件或其他东西。