The new way of doing this is, increasingly, to use SourceLink, which allows source code to be downloaded on demand while debugging.
NOTE: At the time of this writing there are still missing features, as pointed out by Martin Ullrich.
NuGet Symbols Packages and Symbols Servers
Traditionally, there were no .pdb
files in NuGet .nupkg
files.
Instead, the .pdb
files were put into NuGet symbol packages (ending in .symbols.nupkg
).
They can then be hosted on symbol servers (or the local file system), which can in turn be used by the Visual Studio IDE by configuring it accordingly. See also Specify symbol (.pdb) and source files in the Visual Studio debugger.
Do note that not all NuGet package publishers create symbols packages or use SourceLink - if you need to debug an open source library that doesn't have any, perhaps you should consider contributing them.
.pdb
files but the alternative with the NuGet symbol packages (which is new to me) sounds very interesing and it looks like the right way for using.pdb
files. – Ribbentrop