Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps NuGet Feed with Symbols

Tags:

azure-devops

For debugging I need to push my NuGet packages including Symboles to our self-hosted Azure Devops Server.

Therefore I use the dotnet pack task with the flags --include-symbols and --include-source in my build pipeline. As output I get two files package.1.0.0.nupkg and package.1.0.0.symbols.nupkg.

When I try to push the package.1.0.0.symbols.nupkg package in my release pipeline, I get the feedback:

409 (Conflict - The feed already contains "package.1.0.0". (DevOps activity ID: 766B8BC7-9AE6-4998-A246-47397236122F)).

I found Publish *.snupkg symbol package to private feed in VSTS on stack. The feedback is that the Azure DevOps Server do not support NuGet Symbols and they suggest to use a symbol server.

Is it a possible workaround to simply rename the package.1.0.0.symbols.nupkg to package.1.0.0.nupkg and push this package to the feed? Is Visual Studio with able to open the debugger inside the sources of these kind of package?

Is there another way to provide NuGet Symbols for debugging on a Azure DevOps Server?

like image 996
Mar Tin Avatar asked Nov 05 '20 08:11

Mar Tin


Video Answer


1 Answers

There are multiple questions in your post, let us try to solve them one by one.

  1. Is it a possible workaround to simply rename the package.1.0.0.symbols.nupkg to package.1.0.0.nupkg and push this package to the feed?

The answer is no. The error 409 (Conflict - The feed already contains "package.1.0.0" means that you already have one package package.1.0.0.nupkg or package.1.0.0.symbols.nupkg with version 1.0.0 in your feed. So you could not push another package with same version in that feed. Package version in the feed is unique. In order to protect the package from stepping on each other because of the same version of the package.

So, to resolve that error, you need to update the package version, like 1.0.1 (Deleting the old version of the package from the feed will not solve this error).

  1. Is Visual Studio with able to open the debugger inside the sources of these kind of package?

The short answer is yes. The details will be explained in the next question.

  1. Is there another way to provide NuGet Symbols for debugging on a Azure DevOps Server?

The answer is yes, we need to configure Visual Studio to enable debugging remote packages. You could refer below Official document and detailed blog:

Debug with symbols in Visual Studio

ASP.NET Core Debugging Nuget Packages with AzureDevOps | VSTS Symbol Server

  1. But when I use nuget install package then only the package.dll is part of the content which get downloaded from the Azure DevOps Artifacts. Why is that?

This is expected behavior for installing the package. Because most of the time when we install and use the nuget package, we do not need the debug package, so the installation package will only add the dll we need to the project and will not configure the Symbols package. If we want to debug the package, we have to configure the Symbols package like above links.

  1. The feedback is that the Azure DevOps Server do not support NuGet Symbols and they suggest to use a symbol server.

The feedback you mentioned in the question is for *.snupkg symbol package not the symbols package. Azure DevOps Server should support publish NuGet Symbols packages, not debug packages, we have to manually configure Visual studio to use the Azure DevOps Server.

BTW, since there are many questions in your post and they are more general, my answer is not very specific. If you have any questions about any specific questions, you are welcome to open a new post with detailed questions.

like image 83
Leo Liu-MSFT Avatar answered Oct 12 '22 07:10

Leo Liu-MSFT