With the new csproj
format in Visual Studio 2017, it makes it really easy to build nuget packages. If fact, in properties on the project file gives you a gui and you can enter all the nuget info so its just a click away to pack.
However there are no options in the gui to build a symbols.nupkg that includes the source and PDB for a nuget debugging server.
How can I use this new feature in VS2017 and still create a symbols.nupkg?
You shouldn't add pdb files to main nuget package.
The legacy symbol package format, . symbols. nupkg, can be pushed to the SymbolSource repository. Package consumers can then add https://nuget.smbsrc.net to their symbol sources in Visual Studio, which allows stepping into package code in the Visual Studio debugger. See Specify symbol (.
Menu Tools → Options → Package Manager Click OK. Drop your NuGet package files in that folder. Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages". Select your new package source.
Just edit your new csproj
and inside the PropertyGroup
tags add Tags for IncludeSource
and IncludeSymbols
like below. Pack in VS2017 will then make an additional symbols.nupkg.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
</PropertyGroup>
</Project>
To see the whole list of tags available for Nuget package building in the new csproj you can refer to the docs
The accepted answer is valid because it's dated in Mar,2017.
Symbol packages is becoming legacy. symbols.nupkg is still supported but only for compatibility reasons.
The new recommended format for symbol packages is .snupkg Add the following lines in csproj file in vs 2017 :
<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
for more details review: https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
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