Visual Studio 要求导入 pfx 密钥以及导入后依然要求导入的解决办法
2015-11-18 00:22
302 查看
本文为个人博客备份文章,原文地址:
http://validvoid.net/visual-studio-pfx-import/
无法导入以下密钥文件: ****.pfx,该密钥文件可能受密码保护。若要更正此问题,请尝试再次导入证书,或手动将证书安装到具有以下密钥容器名称的强名称 CSP: VS_KEY_****************
Cannot import the following key file: ****.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_****************
这种情况只要依提示将密钥导入即可,具体的操作步骤是:
启动 Visual Studio 命令提示
Visual Studio 2015 以前的版本:
中文版: 开始 -> Microsoft Visual Studio 2015 - >Visual Studio Tools -> Visual Studio 命令提示(201*)
English: Start -> Microsoft Visual Studio 201* -> Visual Studio Tools -> Developer Command Prompt for VS201*
Visual Studio 2015 :
中文版: 开始 -> Visual Studio 2015(文件夹) - > Visual Studio 命令提示(2015)
English: Start -> Visual Studio 2015(Folder) -> Developer Command Prompt for VS2015
在命令提示符中定位到 .pfx 文件所在的目录
在命令提示符中输入
例如:
输入 .pfx 密钥文件的密码,完成导入
完成导入后应该就可以在 Visual Studio 中正常 build 项目了。
Failed to install key pair -- Object already exists
这时可以通过在
提示密钥删除成功后可以通过上述导入步骤重新导入密钥。
如果在删除密钥时获得以下报错:
容器不存在
Container does not exist
这是由于系统中另外某个账户已经导入了密钥,在当前账户中无法对其进行移除。可以尝试登录到早先导入密钥的用户账户对密钥进行移除,然后再切换到要进行 项目 build 的账户重新导入密钥即可。
http://validvoid.net/visual-studio-pfx-import/
导入密钥
在使用 Visual Studio 生产项目时,使用 pfx 密钥签名的项目可能遭遇以下问题:无法导入以下密钥文件: ****.pfx,该密钥文件可能受密码保护。若要更正此问题,请尝试再次导入证书,或手动将证书安装到具有以下密钥容器名称的强名称 CSP: VS_KEY_****************
Cannot import the following key file: ****.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_****************
这种情况只要依提示将密钥导入即可,具体的操作步骤是:
启动 Visual Studio 命令提示
Visual Studio 2015 以前的版本:
中文版: 开始 -> Microsoft Visual Studio 2015 - >Visual Studio Tools -> Visual Studio 命令提示(201*)
English: Start -> Microsoft Visual Studio 201* -> Visual Studio Tools -> Developer Command Prompt for VS201*
Visual Studio 2015 :
中文版: 开始 -> Visual Studio 2015(文件夹) - > Visual Studio 命令提示(2015)
English: Start -> Visual Studio 2015(Folder) -> Developer Command Prompt for VS2015
在命令提示符中定位到 .pfx 文件所在的目录
在命令提示符中输入
sn -i ****.pfx VS_KEY_****************
例如:
sn -i xxxx.pfx VS_KEY_791BAAE3DF288545
输入 .pfx 密钥文件的密码,完成导入
完成导入后应该就可以在 Visual Studio 中正常 build 项目了。
重新导入密钥
有时,在 Visual Studio 要求导入密钥,并执行上述导入步骤时会得到以下报错:Failed to install key pair -- Object already exists
这时可以通过在
Visual Studio 命令提示中执行以下命令移除已经导入的密钥,以便重新导入:
sn -d VS_KEY_****************
提示密钥删除成功后可以通过上述导入步骤重新导入密钥。
如果在删除密钥时获得以下报错:
容器不存在
Container does not exist
这是由于系统中另外某个账户已经导入了密钥,在当前账户中无法对其进行移除。可以尝试登录到早先导入密钥的用户账户对密钥进行移除,然后再切换到要进行 项目 build 的账户重新导入密钥即可。
相关文章推荐
- Android蓝牙开发的一些经验
- babel无法编译?
- null相关
- Qt 框架的图形性能高(OpenGL上的系统效率高),网络性能低,开发效率高,Quick是可以走硬件加速——Qt中分为好几套图形系统,差不多代表了2D描画的发展史。最经典的软描画系统
- [1108]:最小公倍数
- ubuntu 执行make menuconfig ARCH=arm
- HttpClient-----4、使用HttpClient进行POST方式通信
- 开发者文档之多线程编程指南学习笔记
- AndroidStudio 编译错误
- CentOS 搭建 nginx + tomcat
- c++ 默认构造函数,构造函数,复制构造函数,赋值操作符,析构函数调用示例
- HttpClient-----3、使用HttpClient进行GET方式通信
- linux sed命令详解
- Polygon Table - Google Chrome
- Unity键值意义
- 物联网与嵌入式系统概论-week3- Hardware and Software-Lesson3: Operating Systems
- 对sublime的认识(1)
- 浅浅谈Java反射机制( JAVA Reflection)
- C++map遍历删除数据(删除被2整除的键值对)
- 【HDOJ】3337 Guess the number