如何停止在 Release 包中生成 pdb 文件

How to stop generate pdb files in Release package

我正在尝试在 TFS 上实施 CD/CI 管道。我已经创建了构建,所有步骤都已成功,除了发布符号路径。

我收到此错误消息:

2019-09-12T11:34:17.9788901Z ##[错误]无法从 'E:\buildAgent_work\s\Branch\Branche\Api\bin\AWSSDK.CognitoIdentity.pdb' 检索索引源信息。无法检索符号索引。

有人知道如何解决这个问题吗?

谢谢!

How to stop generate pdb files in Release package

这个问题似乎是:

  • 默认值为可移植 - 新的可移植 PDB。
  • TFS 2017 无法读取新的便携式 PDB 格式。

一些可能的解决方法:

  • 升级到 TFS 2018
  • 发布符号时排除AWSSDK.CognitoIdentity.pdb
  • 从源代码构建 AWSSDK.CognitoIdentity 并在项目中设置 <DebugType>None</DebugType>

由于 AWSSDK.CognitoIdentity.pdb 来自 nuget 包 AWSSDK.CognitoIdentity, we could not use the following setting to disable PDB Generation:

<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>

因此,我们可以将 TFS 更新为 2018 或 在发布符号时排除 AWSSDK.CognitoIdentity.pdb

要在发布符号时排除 AWSSDK.CognitoIdentity.pdb,我们可以在发布符号路径任务的搜索模式选项中使用文件匹配模式参考:

**/bin/**/*.pdb
!**/bin/**/Microsoft.WindowsAzure.Storage.pdb

希望这对您有所帮助。

我解决了这个问题。我只需要更改为 Release,而不是 Debug。谢谢!