简体   繁体   English

Azure 神器 Nuget package 调试问题

[英]Azure Artifact Nuget package debugging issue

I'm using Azure Pipeline to build and publish NuGet packages to the Azure Artifact feed.我正在使用 Azure 管道构建 NuGet 包并将其发布到 Azure 工件源。 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).但是,在将 package 安装到示例控制台应用程序中时,我无法调试 package(方法的主体不可见)。

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 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?视图=天蓝色 devops

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.对于那些面临这个问题的人,需要考虑一些与 Azure DevOps API 和符号文件 (PDB) 打包机制相关的问题/案例。 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 PDB 包含有关 package 的所有 cs 文件的信息,并且由于 package 打包过程是在代理本身上完成的,因此有关 cs 文件的信息如下所示: $(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.但是,当 Visual Studio 尝试从 Azure DevOps API 下载文件(参考在 PDB 文件中)时,找不到该文件。 Because the API wants to get the cs file like this: https://azureDevOpsAPIURI/OrganizationID/RepoID/path=/SomeFirectory/File.cs因为API想要得到这样的cs文件: https://azureDevOpsAPIURI/OrganizationID/RepoID/path=/SomeFirectory/File.cs

And this is a conflict between API and PDB files' reference.这是 API 和 PDB 文件参考之间的冲突。 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.我已经设法通过将所有 CS 文件从代理的结帐路径移动到 $(Build.SourcesDirectory) 来解决这个问题,以便摆脱对 Azure DevOps API 的调用中的 RepoName。 I'm not sure if it's a conflict or there is a native way to do this or no.我不确定这是冲突还是有本地方法可以做到这一点或没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM