问题描述
我最近获得了新的代码签名证书.我正在使用MSBuild的SignFile任务对应用程序清单进行签名.由于某种原因,任务正在返回:
I recently got a new code signing certificate. I'm using MSBuild's SignFile task to sign an application manifest. For some reason the task is returning:
MSB3481: The signing certificate could not be located.
Ensure that it is in the current user's personal store.
证书肯定在我的个人商店中,我可以在certmgr.msc中看到它.而且我相信我以同一用户身份登录,因为我能够使用同一个人商店中的其他证书对清单进行签名.不确定为什么找不到此新证书.
The certificate is definitely in my personal store, I can see it in certmgr.msc. And I believe that I'm logged in as the same user since I'm able to sign the manifest using a different certificate that is in the same personal store. Not sure why this new certificate cannot be found.
我什至可以使用带有新证书的SHA1的signtool.exe对文件进行签名.但是我真的更喜欢将我们现有的MSBuild与SignFile任务一起使用.有什么想法可能会出问题吗?
I'm even able to use signtool.exe with the new certificate's SHA1 to sign files just fine. But I would really prefer to use our existing MSBuild with the SignFile task. Any ideas what could be going wrong here?
我也尝试过导入带有或不带有完整证书路径的证书.
I've also tried importing the certificate with and without the complete certification path.
推荐答案
我不确定这是否有帮助,但是我记得如果您要从管理单元字段复制指纹,则第一个位置会有一个不可见"符号.因此,该不可打印的指纹无法在您的商店中找到.尝试从证书指纹的开头(包括引号)中删除3-5个符号,然后手动键入它们.
I not sure that this could help, but I remember that if you are copying thumbprint from snap-in field, there is an "invisible" symbol in first position.So this thumbprint with that non-printable can't be located in your store. Try to remove 3-5 symbols from beginning of certificate thumbprint (including quotes) and type them manually.
还要考虑到指纹应该全部为大写(尽管该属性以小写形式显示).
Also take in account that thumbprint should be all uppercase (despite that property displayed in lowercase).
这篇关于MSBuild SignFile任务返回MSB3481:找不到签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!