How do I debug .NET 4.6 framework source code in Visual Studio 2017?

后端 未结 2 1561
清酒与你
清酒与你 2020-12-01 05:51

Here\'s what I\'ve tried:

Made a new Console App (.NET Framework) in Visual Studio 2017.

Added the following code:

static void Main(string[]          


        
2条回答
  •  孤城傲影
    2020-12-01 06:13

    Use the Symbol Server feature in JetBrains dotPeek. Worked like a charm for me after struggling to get the standard functionality to work:

    1. Run dotPeek and go to Tools > Options... > Symbol Server.
    2. Ensure that "All assemblies" is selected and copy the local symbol server URL to the clipboard. Start the dotPeek symbol server by clicking it in the Tools menu.
    3. In Visual Studio, go to Tools > Options... > Debugging > Symbols and add the dotPeek server URL to the list. Move the dotPeek symbol server as high up the list as possible, and uncheck all other symbol servers in the list (in particular, the "Microsoft Symbol Servers" and "NuGet.org Symbol Server" must not be selected).
    4. Start debugging - when you attempt to step into Framework source code, you will see dotPeek doing some work decompiling the assembly for you, and then you will be into its source.

    If this doesn't work, it's probably because Visual Studio has previously downloaded the "wrong" symbols for the assembly in question from Microsoft/NuGet, and is using them instead of asking dotPeek. To check this, start debugging and find the relevant assembly in the modules list (Debug > Windows > Modules) - delete the PDB file at the path displayed under "Symbol File" for that assembly, then restart debugging, and dotPeek should kick into action.

提交回复
热议问题