签名时出错:未知错误"-2147012894"

Vic*_*r F 4 clickonce vsto digital-certificate visual-studio-2010 pfx

我从https://www.globalsign.co.uk/购买了.pfx证书.我已经使用它签署了我的VSTO(Visual Studio中的Excel加载项项目类型)项目的ClickOnce清单,一切正常.经过一个月的使用,我试图重建我的项目(以前的工作),现在它给了我一个错误:

签名时出错:未知错误"-2147012894"

该证书完全有效且未过期,并且手动签名如下工作完美:SignTool sign/f mycert.pfx/p password somefile.exe

我已经尝试删除个人/证书路径下的certmgr.msc中的所有证书,但它没有帮助.

以前有人有过这种错误吗?有什么建议?

Vic*_*r F 5

令人惊讶的是,修复比预期更容易......我只需打开项目文件并删除与签署程序集相关的所有xml标记.例如:

  <PropertyGroup>
    <SignManifests>true</SignManifests>
  </PropertyGroup>
  <PropertyGroup>
    <ManifestKeyFile>mycert.pfx</ManifestKeyFile>
  </PropertyGroup>
  <PropertyGroup>
    <ManifestCertificateThumbprint>AB3S6</ManifestCertificateThumbprint>
  </PropertyGroup>
  <PropertyGroup>
    <ManifestTimestampUrl>http://timestamp.globalsign.com/scripts/timstamp.dll</ManifestTimestampUrl>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

之后,我只是转到签名选项卡并重新添加证书.这很有效.希望这将有助于未来的人.