Moslem Ben Dhaou
Moslem Ben Dhaou

Reputation: 7005

Can I add GitHub as debugger source in Visual Studio?

I am using some NuGet packages in my projects which have their source publicly available in GitHub (example OrmLite).

How can I configure their repositories as debugger sources in Visual Studio (the same way I could configure ReferenceSource for the .NET Framework etc... like here)?

ReSharper is able to decompile the DLLs, but I am more interested in seeing the comments which are obviously not available this way.

Update:

I know about the pdb files, but the initial intension was to see the source code when I hit F12. For the .NET Framework that is acheived by simply adding the ReferenceSource as I explained before

Upvotes: 7

Views: 1848

Answers (2)

Yair Nevet
Yair Nevet

Reputation: 13003

Use the original source-code from GitHub by download the relevant VS code projects and add them to your solution for references instead of using the binaries.

Upvotes: 0

Philip Pittle
Philip Pittle

Reputation: 12295

What you are looking for is http://symbolsource.org, which is a platform for hosting open source pdb (debugging) files.

To use it, you'll need to update your Visual Studio instance to pull pdb's from there (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:

Note: Not every nuget package also uploads symbols to SymbolSource (as it requires an additional publishing step). So you might need to contact the developer of the project and ask them to upload it, or if the project is open source, you could do it yourself.

Upvotes: 9

Related Questions