导入pfx时无法导入以下密钥文件错误 [英] Cannot import the following key file error when importing pfx

查看:91
本文介绍了导入pfx时无法导入以下密钥文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对stackoverflow进行了彻底的研究,我看到了许多答案,但是还没有一个对我们有用.我们最近从comodo购买了代码签名证书,将用于对c#WPF .net4应用程序进行签名.
我们已经按照

I researched this question thoroughly on stackoverflow and I have seen numerous answers but none of them have worked for us yet. We recently bought a code signing certificate from comodo that we are going to use to sign our c# WPF .net4 application.
We have followed the instructions on the following URL

,然后将证书导入到Visual Studio中的项目属性->唱歌->签署装配"下.然后,我们尝试构建项目并得到以下错误:

and have then imported the certificate in visual studio under 'project properties->singing->sign the assembly'. We then try to build the project and get the following error:

无法导入以下密钥文件:comodo.pfx.密钥文件可能受密码保护.若要更正此问题,请尝试再次将证书导入,并使用以下密钥容器名称将证书手动安装到Strong Name CSP:VS_KEY_xxxxxxxxxxxxxxx.

Cannot import the following key file: comodo.pfx. The key file may be password protected. To correct this, try to import the certificate again manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_xxxxxxxxxxxxxxx.

我们在互联网上找到了许多解决方案,并尝试了以下方法:

We have found numerous solutions on the internet and have tried the following:

  • 单击更改密码",然后在所有3个地方使用相同的密码
  • sn -i [comodo] .pfx VS_KEY_xxxxxxxxxxxxx
  • 尝试将其转换为无密码的snk文件,并使用该文件代替.pfx
  • 尝试将Visual Studio作为管理员运行并导入密钥
  • 尝试创建非常简单的准系统项目并进行签名
  • 尝试过Visual Studio 2010和2012
  • 我们尝试将以下内容添加到程序集[assembly:AssemblyKeyFile("key file的路径")]
  • 在postbuild中添加了事件"C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.0A \ Bin \ signtool.exe" sign/f"$(ProjectDir)[keyfile] .pfx"/p [密码]/v"$(ProjectDir)obj \ Release \ $(TargetFileName)"
  • 在.csproj文件的部分中添加:

  • Click on Change Password and use the same password in all 3 places
  • sn -i [comodo].pfx VS_KEY_xxxxxxxxxxxxx
  • tried converting it to password-less snk file and use that instead of .pfx
  • Tried running visual studio as admin and importing key
  • Tried creating very simple barebones project and signing with that
  • Tried visual studio 2010 as well as 2012
  • We tried adding the following to the assembly [assembly: AssemblyKeyFile("path to key file")]
  • Added event in postbuild "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\signtool.exe" sign /f "$(ProjectDir)[keyfile].pfx" /p [thepassword] /v "$(ProjectDir)obj\Release\$(TargetFileName)"
  • Added in a section in the .csproj file:

已下载 http://visualstudiogallery.msdn.microsoft.com/a83505c6-77b3-44a6-b53b-73d77cba84c8 ,然后点击错误上的应用修复"

Downloaded http://visualstudiogallery.msdn.microsoft.com/a83505c6-77b3-44a6-b53b-73d77cba84c8 and clicked 'Apply Fix' on the error

到目前为止,我们还没有成功.我们可以使用密码很好地导入密钥,因此我们知道密码是正确的.我们也知道,这对于在clickonce发布中的清单签名进行工作很有效.为了确保没有其他问题,我们关闭了信息签名,并试图对程序集进行签名.

We have had no success thus far. We can import the key just fine using the password so we know the password is correct. We also know that this works fine for signing the manifest in a clickonce publish. Just to make sure we weren't having any other issues, we turned off the cilckonce signing and are just trying to sign the assembly.

推荐答案

您只需打开" 项目> 属性> 签名 ",然后取消选中签署ClickOnce清单"复选框.

You can simply open "Project > Property > Signing" and uncheck the "Sign the ClickOnce manifests" checkbox.

这篇关于导入pfx时无法导入以下密钥文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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