While investigating issues in a .net solution, I am encountering problems as I am unable to do debug or do any action. This is causing issues with debugging, such as breakpoints hitting or setting them properly.
The issue is where Visual Studio isn’t able to find any source classes of the solution and its projects. It loads them as external sources, and allows showing some classes during debugging but not the actual source code breakpoints or parameter values during the run.
The issue is shown as:
Source Not Found:
This happens for example when it hits one of previously defined breakpoints on any possible class in any project in the solution. Where these get loaded under:
Amongst the tried options were (which all were unsuccessful, and why I am here searching for answers):
- Testing on another machine.
- Not occurring on the other machine/machines.
- Removing the .vs folder within the solution.
- Re-clonning the project.
- Updating Visual Studio.
- Setting MSBuild project build output verbosity: Diagnostic output under Tools => Options => Project and Solutions => Build and Run.
- Disabling Enable address-level debugging under Tools => Options => Debugging.
- Enabling Just My Code** under Tools => Options => Debugging.
Ideally would be to have proper debugging capabilities and run without having this issue where it occurs that my project depends on external sources to run and being unable to properly debug.
2
Answers
I was not able to pinpoint the actual issue on what caused it. As it was most probably based on the actual issue, related to local development environment setup, and as @Minxin YU -MSFT mentioned, resetting it would probably resolve it. Which it did. But it did not provide any information on what was the actual root cause.
There are multiple options of doing it, and here are some I tried:
Using the Repair functionality from the Visual Studio Installer
Using the Tools ⇾ Import and Export Settings feature and resetting it from there.
And using the Developer Command Prompt option
devenv /ResetSettings
The one that worked for me was, the first option.
Make sure that the class which you are debugging, that its containing dll has it’s latest coresponding pdb file.