VS 2005发布 - 构建失败 - SignTool报告'密钥集不存在' -
从VS 2005发布VB应用程序时遇到此错误?
答案 0 :(得分:0)
我发布了我的VB应用程序数百万次,没有任何问题,但有一天,我遇到了这个棘手的错误。尽管有签名证书,视觉工作室无法找到它。我想这是VS偶尔会出现的恐慌慢动作攻击之一。经过两个多小时的讨论后,终于解决了这个问题,而无需从我的应用程序的表格n文件中重新创建一个新的解决方案......如某些网站所建议的那样。
以前我也遇到过这个错误,但我当时通过创建一个新的测试证书解决了这个问题,尽管我不得不在客户端机器上删除并重新安装我的应用程序以获取新的发布,因为这是一个新的证书。这次Visual Studio甚至不允许我创建新证书。我尝试时遇到了这个令人讨厌的错误 - 系统无法找到visual studio中指定的文件(HRESULT异常:0X80070002)。当我尝试使用运行命令中的certmgr.msc检查我的证书时,我可以看到我的证书存在于本地当前用户证书下的个人存储中。我还将我的证书复制到受信任的证书文件夹下,但无济于事。
在完成四件事后,我的问题终于得到了解决,我再次愉快地发布了同样的解决方案。
1. Close your solution. Delete the bin and obj folders of your solution. Remove the following tag lines from your .csproj file. Copy these four lines somewhere as backup.<ManifestCertificateThumbprint>...</ManifestCertificateThumbprint>
Reopen your solution in VS and clean and re-build. Try Publishing after increasing the version number. It displays a different error that certificate is not found. Now close VS. Re-add those four lines back in the csproj file where they originally were in that file. 2. Reopen your project in VS and under Project Properties in Signing tab, uncheck the "Sign the Click Once manifests" and re-check again. Also do the same for Sign the assembly checkbox. Select the latest .pfx key. Save. Close and re-open Project Properties. (This pfx is the key generated whenever we create a new certificate. Check the date of the .pfx in project folder to know which was the last one you had created and use that one. Personally I don't give any password while creating new certificate on expiry. ) Also, add your certificate that is present in Personal Store to the Trusted Certificate Store as well using the certmgr.msc console. Simply copy your VS application issued certificate from Personal Certificates folder to Trusted Root Certificates (if there exists a trusted root authority store) in the certificate Manager console panel - the screen that comes after typing certmgr.msc in run command. 3. Now Restart your system. Yes you read that right. 4. Open your project again in VS. Increase the version now and try Publishing. Voila, the publish goes fine.
<ManifestKeyFile>...</ManifestKeyFile>
<GenerateManifests>...</GenerateManifests>
<SignManifests>...</SignManifests>
PS:VS 2005在清单级别进行的更改中醒来有点晚。有时也会发生水晶报告问题:(。所以最好花一些时间在这些更改后重新加载VS. :)步骤1正在做的是提醒视觉工作室它需要一个证书,它通常在本地密钥库中找到它。所以keystore不存在错误没有意义:)!
请注意,我还尝试将现有项目证书导入到本地PC的个人证书存储区(可以使用<运行命令在 certmgr.msc 中检查本地商店证书列表)< strong> MMC 运行命令的控制台管理单元,但我收到错误,需要加密服务提供程序,并且我的系统上没有安装它。此外,我可以看到我的证书已存在于个人证书存储区中。它只是Visual Studio忘记了它在哪里以及它是哪一个。我在某处读到,如果开发机器中有太多/多个发布,就会发生这种情况。 :d