t3chb0t
t3chb0t

Reputation: 18655

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?

Upvotes: 6

Views: 3566

Answers (1)

NightOwl888
NightOwl888

Reputation: 56859

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.

Upvotes: 4

Related Questions