Cannot find .cs files for debugging .NET source code

后端 未结 11 2179
清酒与你
清酒与你 2020-11-29 23:04

I tried setting up debugging the .NET source by following this MDSN walkthrough. The Symbol cache is setup properly, as is the check \'Enable .NET Framework source stepping\

相关标签:
11条回答
  • 2020-11-29 23:13

    Clean the solution before build solved the issue for me.

    Just navigate and click on:

    1. Build -> Clean Solution.
    2. Build -> Build Solution (Ctrl + Shift + B).
    0 讨论(0)
  • 2020-11-29 23:19

    Well, in my case I was not trying to debug the .Net framework, but I was getting the same error: Cannot find .cs files for debugging .NET source code. So I had to turn on the "Enable just my code" option under:
    Tools -> Options -> Debugging -> General -> Enable just my Code

    Per MS docs:

    You can configure Visual Studio to automatically step over system, framework, and other non-user calls and collapse those calls in the call stack window.

    https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code

    0 讨论(0)
  • 2020-11-29 23:19

    Checking Tools -> Options -> Debugging -> General -> Enable source server support mysteriously made everything work. I hope the same is true for you

    0 讨论(0)
  • 2020-11-29 23:20

    In my case I wound up renaming the class. Maybe it was getting confused with some other module. Once I had renamed it I could step in.

    0 讨论(0)
  • 2020-11-29 23:21

    You can find source code here to download so you can debug properly. https://referencesource.microsoft.com/#mscorlib,namespaces

    0 讨论(0)
  • 2020-11-29 23:21

    I got this error when updating a NuGet package in a project, while missing to update it in other projects of the solution.

    Going to the NuGet Manager of the solution and using the consolidate function, which ensures all projects in the solution use the same version, resolved the problem for me.

    0 讨论(0)
提交回复
热议问题