简体   繁体   English

在Visual Studio 2013中为.NET 3.5调试添加调试符号

[英]Add debug symbols for .NET 3.5 Debugging in Visual Studio 2013

I have a Unity application and a C# DLL, created by Visual Studio 2013, that I want to debug. 我有一个Unity应用程序和一个由Visual Studio 2013创建的C#DLL,我想调试它。 I do this by going to DEBUG > Attach to Process inside Visual Studio 2013, and if I choose Native code, I can set breakpoints for C++ code and etc. However, when I choose the option for .NET 3.5, it says that the breakpoint will never be reached as the symbols have not been loaded. 我这样做是通过在Visual Studio 2013中进入DEBUG > Attach to Process ,如果我选择Native代码,我可以为C ++代码等设置断点。但是,当我选择.NET 3.5的选项时,它会说断点因为符号尚未加载,所以永远不会到达。

How do I load debug symbols for .NET 3.5 for Visual Studio 2013? 如何为Visual Studio 2013加载.NET 3.5的调试符号?

Please have a look at the below MSDN links 请查看以下MSDN链接

https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2017

https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-debug-dotnet-framework-source?view=vs-2017

You can load the symbols from pdf file and making configurations in pdb file you can manage the symbols while debugging the application. 您可以从pdf文件加载符号并在pdb文件中进行配置,您可以在调试应用程序时管理符号。

Ok, 好,

The answer is simple, you have a dll, debug symbols are .pdb files. 答案很简单,你有一个dll,调试符号是.pdb文件。 You need to open and build c# solution (class library) in visual studio and look in the output directory of the project, usualy bin->debug. 您需要在visual studio中打开并构建c#solution(类库)并查看项目的输出目录,通常是bin-> debug。 Get the pdb and store them somewhere. 获取pdb并将它们存储在某个地方。 Then when you run your unity applicatio, you use visual studio (can be any version of visual doesnt matter), attach to process, but make sure the pdb's you saved have been loaded into visual studio by following the microsoft documentation above. 然后当你运行你的统一应用程序时,你使用visual studio(可以是任何版本的视觉无关紧要),附加到进程,但请确保你保存的pdb已经通过上面的microsoft文档加载到visual studio中。

If you don't have the library's symbols file, you can decompile the library with the free decompiler dotPeek and attach Visual Studio to the dotPeek's symbols server . 如果您没有库的符号文件,则可以使用免费的反编译器dotPeek对库进行反编译,并将Visual Studio附加到dotPeek的符号服务器

Then disable Enable Just My Code in Visual Studio's debugging option. 然后在Visual Studio的调试选项中禁用“ Enable Just My Code Remember to enable it again, when you're done, because it hurts the performance. 当你完成时,请记得再次启用它,因为它会影响性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM