I have two solutions in my workspace, say A and B.
Solution A is an older project which I finished coding some time ago. In solution B, I need to use some classes fr
I had the same issue. He is what I found:
1) make sure all projects are using the same Framework (this is crucial!)
2) in Tools/Options>Debugging>General make sure "Enable Just My Code (Managed Only) is NOT ticked
3) in Tools/Options>Debugging>Symbols clear any cached symbols, untick and delete all folder locations under the "Symbols file (.pdb) locations" listbox except the default "Microsoft Symbol Servers" but still untick it too. Also delete any static paths in the "Cache symbols in this directory" textbox. Click the "Empty Symbols Cache" button. Finally make sure the "Only specified modules" radio button is ticked.
4) in the Build/Configuration Manager menu for all projects make sure the configuration is in Debug mode.
If you have a project reference, it should work immediately.
If it is a file (dll) reference, you need the debugging symbols (the "pdb" file) to be in the same folder as the dll. Check that your projects are generating debug symbols (project properties => Build => Advanced => Output / Debug Info = full); and if you have copied the dll, put the pdb with it.
You can also load symbols directly in the IDE if you don't want to copy any files, but it is more work.
The easiest option is to use project references!
Make sure your DLL is not registered in the GAC. Visual Studio will use the version in the GAC and it will probably have no debugging information.
The most straigh forward way I found using VisualStudio 2019 to debug an external library to which you are referencing in NuGet, is by taking the following steps:
Tools > Options > Debugging > General > Untick 'Enable Just My Code'
Go to Assembly Explorer > Open from NuGet Packages Cache
Type the NuGet package name you want to debug in the search field & click 'OK'
From the Assembly Explorer, right-click on the assembly imported and select 'Generate Pdb'
Select a custom path where you want to save the .PDB file and the framework you want this to be generated for
Copy the .PDB file from the folder generated to your Debug folder and you can now set breakpoints on this assembly's library code