c# - 我可以在 Visual Studio 中将 GitHub 添加为调试器源吗?

标签 c# visual-studio debugging github nuget

我在我的项目中使用了一些 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):

  1. Go to Tools -> Options -> Debugger -> General.
    1. Uncheck “Enable Just My Code (Managed only)”.
    2. 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).
    3. Check “Enable source server support”.
    4. Uncheck “Require source files to exactly match the original version”
    5. Go to Tools -> Options -> Debugger -> Symbols.
    6. Select a folder for the local symbol/source cache.
    7. 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:

注意:并非每个 nuget 包都会将符号上传到 SymbolSource(因为它需要额外的发布步骤)。所以你可能需要联系项目的开发者让他们上传,或者如果项目是开源的,你可以自己做。

关于c# - 我可以在 Visual Studio 中将 GitHub 添加为调试器源吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32979942/

相关文章:

c++ - fopen_s(&file, "filename", mode) 在 vi​​sual studio 2019 C_language 中不起作用

visual-studio - Visual Studio 2013 Ultimate 调试器未显示整个列表

android - 在 Android Studio 中运行 Robolectric 测试时如何调试?

objective-c - 堆栈跟踪中方法名称旁边的数字是什么?

c# - 访问 UWP 页面之间传递的参数

c# - 如何使用 C# 在 WinForm 中手动绑定(bind)到低功耗蓝牙设备?

c++ - 将 VS 32 位项目转换为 64 位项目

c# - IAsyncEnumerable 在 C# 8.0 预览中不起作用

c# - 在 Visual C# 中从 RichTextBox 中删除 RichText 格式

c# - visual c# 2005 方法中的输入