Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy NuGet .pdb to output directory

When I build an ASP.NET Core project it copies to the output directory only its own .pdb files and all .dlls 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?

like image 542
t3chb0t Avatar asked Feb 18 '18 15:02

t3chb0t


1 Answers

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.

like image 140
NightOwl888 Avatar answered Oct 29 '22 13:10

NightOwl888