我在我的项目中使用了一些 NuGet 包,它们的源代码在 GitHub 上公开可用(示例 OrmLite)。
如何在 Visual Studio 中将它们的存储库配置为调试器源(与我为 .NET Framework 等配置 ReferenceSource 的方式相同... like here)?
ReSharper 能够反编译 DLL,但我更感兴趣的是看到显然无法通过这种方式获得的评论。
更新:
我知道 pdb
文件,但最初的意图是在按 F12 时查看源代码。对于 .NET Framework,只需添加我之前解释的 ReferenceSource 即可实现
最佳答案
您要找的是http://symbolsource.org ,这是一个托管开源 pdb(调试)文件的平台。
要使用它,您需要更新您的 Visual Studio 实例以从那里提取 pdb (http://www.symbolsource.org/Public/Home/VisualStudio):
- Go to Tools -> Options -> Debugger -> General.
- Uncheck “Enable Just My Code (Managed only)”.
- Uncheck “Enable .NET Framework source stepping”. Yes, it is misleading, but if you don't, then Visual Studio will ignore your custom server order (see further on).
- Check “Enable source server support”.
- Uncheck “Require source files to exactly match the original version”
- Go to Tools -> Options -> Debugger -> Symbols.
- Select a folder for the local symbol/source cache.
- Add symbol servers under “Symbol file (.pdb) locations”. Pay attention to the correct order, because some servers may contain symbols for the same binaries: with or without sources. We recommend the following setup:
- http://referencesource.microsoft.com/symbols
- http://srv.symbolsource.org/pdb/Public or the authenticated variant (see above)
- http://srv.symbolsource.org/pdb/MyGet or the authenticated variant (see above)
- (other symbol servers with sources)
- http://msdl.microsoft.com/download/symbols
- (other symbol servers without sources)
注意:并非每个 nuget 包都会将符号上传到 SymbolSource(因为它需要额外的发布步骤)。所以你可能需要联系项目的开发者让他们上传,或者如果项目是开源的,你可以自己做。
关于c# - 我可以在 Visual Studio 中将 GitHub 添加为调试器源吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32979942/