Visual Studio 报告错误“PFX - 导入密钥/对象已存在时出错”
我有一个 Visual Studio 2008 ClickOnce 解决方案,我尝试在打开“Sign Manifest”的情况下进行编译。
选中此选项后,系统会提示我输入 PFX 文件密码,输入正确的密码后,我收到错误消息:
“导入密钥时出错”/“对象已存在”。
我确信我已经浇过水了。 我尝试运行以下命令但无济于事。
CERTUTIL -importPFX -user <pfxname>.pfx AT_SIGNATURE
I have a Visual Studio 2008 ClickOnce solution that I am attempting to compile with "Sign Manifest" turned on.
With this option checked, I am prompted for my PFX files password, and upon entering the correct password I receive the error:
"Error Importing Key" / "Object already exists".
I'm sure I've hosed something. I've tried to run the following to no avail.
CERTUTIL -importPFX -user <pfxname>.pfx AT_SIGNATURE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我目前也遇到了困难。 我的情况与此有所不同,因为我正在尝试为我的程序集生成强名称密钥文件,
我尚未解决该问题,但我相信这是由于无论出于何种原因密钥已存在于密钥存储中而引起的用于生成密钥的 CSP。 为什么密钥已经存在,我不知道,也没有找到删除它的方法,但当我这样做时我会更新这个问题
I too am currently having difficulty with this. My situation is somewhat different to this in that I am attempting to generate a strong-name key file for my assembly
I haven't yet solved the issue but I believe it is caused because, for whatever reason the key already exists in the key store for the CSP used to generate the key. Why the key already exists, I don't know, nor have I found a way to remove it but I will update this question when I do
我有同样的问题。 使用“以管理员身份运行”启动 Visual Studio 解决了该问题。
I had the same problem. Starting Visual Studio with 'Run as Administrator' solved the issue.
我不知道这是否有助于解决此问题,但从 Vista 升级到 Windows 7 后我遇到了类似的问题,只需更改 MachineKeys 文件夹的权限(C:\Documents and Settings\All Users\ApplicationData\Microsoft Windows 7 中的 \Crypto\RSA\)
请参见此处:
证书问题 - 导入密钥时出错Windows 7 升级后“对象已存在”
让我知道这是否有帮助:)
I don't know if this will help for this problem, but I had something similar after a Vista to Windows 7 upgrade, and simply had to change permissions on the MachineKeys folder (C:\Documents and Settings\All Users\ApplicationData\Microsoft\Crypto\RSA\ in Windows 7)
See here:
Certificate problem - Error Importing Key "object already exists" after Windows 7 upgrade
Let me know if this was helpful :)
我刚刚发现解决此问题的另一种方法:取消选中“签署 ClickOnce 清单”,从解决方案资源管理器中的项目中排除证书文件。 重命名证书文件。 只要是不同的,什么都没关系。 重新启用签名并选择新文件。 按要求输入密码。 建造,耶!
Another way I just discovered to fix this: Uncheck the "Sign the ClickOnce Manifests", exclude the cert file from the project in the Solution Explorer. Rename the cert file. Doesn't matter what, as long as it's different. Re-enable signing and choose the new file. Enter the password as requested. Build, yay!
只是想添加我自己对这个问题的经验。
我的系统是在进行了一系列系统类型更改后突然出现的……其中之一是打开 Vista UAC 来测试我正在开发的应用程序。
遇到了这个确切的问题,它无法编译。 我吓坏了...
...修复权限似乎在 ...\RSA\MachineKeys 文件夹上似乎已经使问题消失了,但查看其权限并注意到 devenv.exe (VS IDE)是没有告诉“以管理员身份运行”,此问题可能是由 UAC 限制引起的。
我讨厌 Vista 中的伪管理模式......
Just wanted to add my own experience with this problem.
Mine came suddenly after doing a bunch of system-type changes... one of them being switching on Vista UAC to test the app I am working on.
Ran into this exact problem and it wouldn't compile. I'm freaking out...
... fixing the permissions seems on the ...\RSA\MachineKeys folder seems to have made the problem go away but looking at its permissions and noticing that devenv.exe (the VS IDE) was not told to "Run as Administrator" it is possible that this issue may be caused by UAC restrictions.
I hate the pseudo-admin mode in Vista....