I see this has become a popular question, however, MS is (as for the most time nowadays in Visual Studio) absent in requests that actually can improve their product.
There are some posts around out there on how to use the reference library from Microsoft, but this doesn't apply to all projects plus you will debug optimized release bits which is limiting in both watch and step capabilities. I also feel that this way to do it even slows down a slow Visual Studio even more. This way to do it is described in this post.
However, lately I have found a way to work around this issue. It isn't always stable, but what can be done is to add the related project to your project as a project reference.
But here are the steps I have done that mostly works:
- Clone the repository of the nuget package from github (or other source)
- Try your best to find which commit that the nuget package was built from (most projects references with either tags or branches, but don't expect this, it may be better to compare dates on the nuget package and commits).
- Follow the instructions from the project on how to build it, some is simply building in Visual Studio other may require more steps like using some build scripts in command prompt.
- Add a reference to the project in the solution, some times you'll also need to add the project that the project references to, but not always. Haven't found exactly the rules here yet. It seems that newer Visual Studio updates doesn't need this.
- Add a reference to the project in ALL projects that references the nuget package within your solution. Failure to do so may cause conflicts which the compiler tries it best (not good enough) to solve.
Build and debug, in your output window check that the assembly located in your project's output folder is used. If it is, just hit breakpoints in the referenced projects and you'll have full debug functionality.
It is a bit of trying and failing to make this work, but it does work eventually.
It is possible to create conditions on the project references to ensure that they isn't built in e.g. release builds, however, be aware that changing configuration requires that you reload your solution AFTER the change!