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

I have a .pfx certificate purchased from https://www.globalsign.co.uk/ . I signed the ClickOnce manifest of my VSTO project (Excel Add-in Add-in in Visual Studio) with it, and it worked. After a month of use, I tried rebuilding my project (which worked), and now it gives me an error:

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

The certificate works fine and has not expired, and a manual signature, like the following, works fine: SignTool sign / f mycert.pfx / p password somefile.exe

I tried to delete all certificates in certmgr.msc under the Personal / Certificates path, but this did not help.

Has anyone had such an error before? Any suggestions?

+4
source share
2 answers

Surprisingly, the fix was easier than expected ... I just had to open the project file and remove all the xml tags that were associated with the assembly signature. 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 that, I simply switched to the Signing tab and re-added the certificate. And it worked. Hope this helps someone in the future.

+5
source

I would suggest that the certificate used to create your project is not the one you use when signing it manually, otherwise it will work.

Go to the project properties for your project and go to the "Signing" tab and see. If you still think this is correct, click "select from file" and select the pfx file again to reload it, and try again.

+3
source

All Articles