[英]Visual Studio 2008: How to load source code while debugging
When debugging in Visual Studio 2008 I get the error "There is no source code available for the current location" but it does not prompt me to browse for source code. 在Visual Studio 2008中进行调试时,我收到错误“没有可用于当前位置的源代码”,但它不会提示我浏览源代码。 If I click "Show Disasembly" and then right click to select "Go to source code" I get the error "The source code cannot be displayed. 如果我单击“显示Disasembly”,然后右键单击选择“转到源代码”,我收到错误“无法显示源代码。
How do I load the source code while in debug mode? 如何在调试模式下加载源代码?
Edit: I have the source code (it is just another class which is not part of this solution) and it is compiled in debug mode. 编辑:我有源代码(它只是另一个不属于此解决方案的类),它是在调试模式下编译的。
If you are debugging from a different location to where you originally built the solution, ie you have attached to a process which has debugging symbols: 如果从最初构建解决方案的位置进行调试,即已连接到具有调试符号的进程:
You can tell visual studio where the source is located by right clicking on the solution in the solution explorer and adding the path-to-your-source to the "Directories containing source code" under the "Debug Source Files". 您可以通过右键单击解决方案资源管理器中的解决方案并将“路径到源”添加到“调试源文件”下的“包含源代码的目录”,来告诉visual studio源所在的位置。
I have tried this under VS2008 only. 我只在VS2008下尝试了这个。
I just found the problem. 我刚发现了这个问题。 There was an incorrect reference in a project just checked in by another developer. 在刚刚由另一位开发人员签入的项目中有错误的引用。 This is why I hate solutions with 20 projects. 这就是为什么我讨厌20个项目的解决方案。
I have had similar messages when I was trying to debug a dll compiled in release mode. 当我尝试调试在发布模式下编译的dll时,我有类似的消息。 In these cases I just recompiled them in Debug mode. 在这些情况下,我只是在调试模式下重新编译它们。
When this happens to me I just add that project to my solution. 当我遇到这种情况时,我只是将该项目添加到我的解决方案中。 Alternatively you should be able to load the assembly's PDB into your Symbols. 或者,您应该能够将程序集的PDB加载到符号中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.