MSBuild SignFile task returning MSB3481: signature certificate could not be found

I recently received a new code signing certificate. I am using the MSBuild SignFile task to sign the application manifest. For some reason, the task returns:

MSB3481: The signing certificate could not be located. Ensure that it is in the current user personal store. 

The certificate is definitely located in my personal store, I see it in certmgr.msc. And I believe that I am registered as the same user, since I can sign the manifest using a different certificate located in the same personal store. I do not know why this new certificate was not found.

I can even use signtool.exe with the new SHA1 certificate to sign files just fine. But I would rather use our existing MSBuild with the SignFile task. Any ideas what might be wrong here?

I also tried to import the certificate with and without a full certification path.

+4
source share
1 answer

I'm not sure if this can help, but I remember that if you copy the fingerprint from the binding field, there is an โ€œinvisibleโ€ character in the first position. Therefore, this print with this non-print cannot be located in your store. Try to remove 3-5 characters from the beginning of the certificate fingerprint (including quotation marks) and type them manually.

Also note that the fingerprint must be uppercase (although the property is displayed in lowercase).

+13
source

All Articles