Creating a nuget package with symbols is quite easy.
You have 2 possible methods to create a nuget package with symbols:
- From nuspec file. How to create nuspec file.
nuget pack MyPackage.nuspec -Symbols
- From project file.
nuget pack MyProject.csproj -Symbols
Both of the commands will create 2 files {identifier}.symbols.nupkg
and {identifier}.nupkg
.
Publishing the nuget package
Normally I upload nuget package by just using drag&drop on the nuget upload page. This doesn't work with symbol packages, because you have 2 packages in the folder.
To publish symbol and normal package, you must use the nuget cli.
- Get and set your Nuget API key.
- Create both (normal + symbol) package. See the 2 possible options above.
- Run
nuget push {identifier}.nupkg -Source https://www.nuget.org/api/v2/package
.
This will upload the {identifier}.nupkg
to nuget and {identifier}.symbols.nupkg
to the symbol server.
If the uploads were successful, result should look like this:
Part 2 of this tutorial will show how to use the symbol package to debug trough third party code.
Sources:
https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages
https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package
Posted
Oct 27 2017, 11:39 AM
by
Holger Vetter