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\
Clean the solution before build solved the issue for me.
Just navigate and click on:
Build
-> Clean Solution
.Build
-> Build Solution (Ctrl + Shift + B)
.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
Checking Tools
-> Options
-> Debugging
-> General
-> Enable source server support
mysteriously made everything work. I hope the same is true for you
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.
You can find source code here to download so you can debug properly. https://referencesource.microsoft.com/#mscorlib,namespaces
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.