When I build an ASP.NET Core project it copies to the output directory only its own .pdb
files and all .dll
s of any installed NuGet packages. However, it does not copy their .pdb
files. I have to select them manually from the %UserProfile%\.nuget\packages
directory.
I was wondering whether there is an option to enable NuGet package .pdb
to be copied to the output directory?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With