0
votes

I'm using Azure Pipeline to build and publish NuGet packages to the Azure Artifact feed. The pipeline includes the Publish Symbols task as below:

- task: PublishSymbols@2
  inputs:
    SearchPattern: '**/bin/**/*.pdb'
    SymbolServerType: 'TeamServices'

However, when installing the package into the sample console app I can not debug the package (the body of the methods is not visible).

I'm using C# .NET Core 3.1 Pipeline Type: YAML Used this article to config the Visual Studio https://docs.microsoft.com/en-us/azure/devops/artifacts/symbols/setting-up-github-sourcelinking?view=azure-devops

1
Did you uncheck Just My Code option under VS Tools-->Options-->Debugging-->General?Mr Qian
Yes, I did. However, I don't think the problem is coming from the Visual Studio. I couldn't find any document which confirms that by default Azure Artifact can accept Symbols. I saw a blog post that says that I need to enable Symbols Server using Maven, which is strange. Also, I run the PowerShell task to list the files which contain *.symbols.nupkg before pushing to Azure Artifact, however I'm getting 0 files.David Mosyan
The other question is does the Azure DevOps support Symbol server. And if yes, how can I find the URL?David Mosyan

1 Answers

0
votes

For those who face this issue needs to take into consideration some issue/case related to Azure DevOps API and the Symbol file (PDB) packaging mechanism. The PDB contains the information regarding all the cs files regarding the package and because the package packing process is done on the Agent itself the information regarding the cs files is like this: $(Build.SourcesDirectory)/RepoName/SomeDirectory/File.cs

However, when the Visual Studio tries to download the file (the reference is in the PDB file) from the Azure DevOps API, it can not find the file. Because the API wants to get the cs file like this: https://azureDevOpsAPIURI/OrganizationID/RepoID/path=/SomeFirectory/File.cs

And this is a conflict between API and PDB files' reference. I have managed to solve this problem by Moving all the CS files from the Agent's checkout path to $(Build.SourcesDirectory) in order to get rid of the RepoName in the call to Azure DevOps API. I'm not sure if it's a conflict or there is a native way to do this or no.