Publish *.snupkg symbol package to private feed in VSTS

Azure Artifacts does not currently support .snupkgs but it does have a symbol server to which you can publish if you're building using Azure Pipelines. This doc walks through setting up a pipeline that publishes symbols.


You may well want to just embed the symbol PDB in the main NuGet package itself. IMO that's the best approach here today - it's much simpler, removing the need for the symbol server at all and works well with all repository types, private VSTS/Azure DevOps feeds public repos. The only downside is that clients have to download modestly bigger NuGet packages even if they don't use the debug info, but that seems minor.

Adding the PDB in the NuGet package is normally just a matter of adding this to your project file:

<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

See NuGet #4142 and Include pdb files into my nuget (nupkg) files.


You can publish the snupkg files to Azure DevOps, but at this point, you cannot consume them from with VS to debug. Here is how I did it:

1) setup a "Use .Net Core" task to upgrade the .net sdk to the version that supports this (as below)

SDK install

2) setup a custom dotnet pack command (as below)

pack command

3) push it to Azure using the dotnet push command (as below)

dotnet push setup

This results in the snupkg being pushed to Azure DevOps Artifacts, thus:

result


Publish *.snupkg symbol package to private feed in VSTS

You can publish the .snupkg symbol package to NuGet.org, or to any NuGet server that opts into this experience. But azure devops private feed does not have this experience.

You can get the detailed info from this wiki NuGet Package Debugging & Symbols Improvements:

  • When publishing packages, both the symbols package and the .nupkg will be easily published to NuGet.org, or to any NuGet server that opts into this experience.

Reason:

As we know, when we consume .snupkg in Visual Studio, we add a new symbol server location under Symbol file (.pdb) locations:

enter image description here

But Visual Studio can only parse the symbol file (.pdb) directly rather than the .snupkg package, so we need a NuGet server to help us read the .pdb file from the .snupkg package. Azure devops feed is more inclined to be a shared repository of packages.

So, we have to publish *.snupkg symbol package to NuGet.org, or to any NuGet server that opts into this experience.

If you do not want share your package on the nuget.org, You can host your own NuGet server or you can use a lightweight solution to resolve this issue (You can debug the nuget package with private feed).

Hope this helps.