【问题标题】:How to work around the PFX signing not supported error when publishing .NET Core发布 .NET Core 时如何解决 PFX 签名不支持错误
【发布时间】:2018-06-29 16:07:07
【问题描述】:

我一直在尝试使用 PFX 文件对程序集进行签名。一切正常,我在 Visual Studio 中访问了属性/签名,但每当我运行 dotnet publish 命令时,我都会收到以下错误:

C:\Program Files\dotnet\sdk\2.1.201\Microsoft.Common.CurrentVersion.targets(3210,5):.NET Core 不支持错误 PFX 签名

我一直在寻找解决此问题的方法,但到目前为止没有运气。

【问题讨论】:

标签: visual-studio .net-core certificate publish pfx


【解决方案1】:

所以我想我应该使用 SNK 签名而不是 PFX,因为 PFX 不再支持它。

【讨论】:

    【解决方案2】:
    1. 从 PFX 导出公钥:sn -p key.pfx key.pub
    2. 通过将<DelaySign>true</DelaySign> 添加到项目文件或AssemblyDelaySignAttribute 为您的程序集启用延迟签名。使用第 1 步中的公钥而不是 PFX 进行签名。
    3. 构建后重新签署您的程序集:sn -R assembly.dll key.pfx

    https://docs.microsoft.com/en-us/dotnet/framework/tools/sn-exe-strong-name-tool

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-25
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-05
      • 1970-01-01
      • 2011-10-23
      相关资源
      最近更新 更多