签名时发生错误:未知错误“ -2147012894” [英] An error occurred while signing: Unknown error "-2147012894"

查看:783
本文介绍了签名时发生错误:未知错误“ -2147012894”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有从 https://www.globalsign.co.uk/ 购买的.pfx证书。我已经用它签署了我的VSTO(Visual Studio中的Excel外接程序项目类型)项目的ClickOnce清单,并且一切正常。在使用了一个月之后,我尝试重建我的项目(该项目曾经可以正常工作),现在却给了我一个错误:

I have .pfx certificate bought from https://www.globalsign.co.uk/. I've signed the ClickOnce manifest of my VSTO (Excel Add-In project type in Visual Studio) project with it and everything worked. After a month of use, I've tried to rebuilding my project (that used to work) and now it gives me an error:


签名时发生错误:未知错误 -2147012894

An error occurred while signing: Unknown error "-2147012894"

证书完全有效且未过期,并且像下面这样手动签名非常有效:SignTool登录/ f mycert.pfx / p密码somefile.exe

The certificate is perfectly valid and not expired and signing manually like following works perfectly: SignTool sign /f mycert.pfx /p password somefile.exe

我尝试删除个人/证书路径下certmgr.msc中的所有证书,但是

I've tried removing all of the certificates in certmgr.msc under the Personal/Certificates path, but it didn't help.

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

推荐答案

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

Suprisingly the fix was easier than expected... I simply had to open the project file and remove all of the xml tags that were related to signing an assembly. So for example:

  <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>

之后,我只是转到签名选项卡并重新添加了证书。这行得通。希望这会对以后的人有所帮助。

After, I've simply went to Signing tab and re-added the certificate. And this worked. Hopefully this will help someone in the future.

这篇关于签名时发生错误:未知错误“ -2147012894”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆