Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 847
Moslem Ben Dhaou Avatar asked Oct 06 '15 21:10

Moslem Ben Dhaou


People also ask

How do I pull code from GitHub to Visual Studio?

Clone a GitHub repo and then open a project Open Visual Studio 2019 version 16.7 or earlier. On the start window, select Clone or check out code. Enter or type the repository location, and then select Clone. Visual Studio opens the project from the repo.

How do I run a GitHub project in Visual Studio?

Open a project locally from a previously cloned GitHub repo Open Visual Studio 2019 version 16.8 or later. On the start window, select Open a project or solution. Visual Studio opens an instance of File Explorer, where you can browse to your solution or project, and then select it to open it.


1 Answers

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:
      • 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)

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.

like image 158
Philip Pittle Avatar answered Sep 20 '22 12:09

Philip Pittle