The solution that Visual Studio requires to import the PFX key and still require import after import

Source: Internet
Author: User
Tags pfx file

This article is a personal blog backup article, the original address:

http://validvoid.net/visual-studio-pfx-import/

Import Key

When you use Visual Studio production projects, items that are signed with a PFX key may experience the following issues:

Unable to import the following key file: ****.pfx, the key file may be password protected. To correct this problem, try importing the certificate again, or manually install the certificate to a strong name with the following key container name 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 F Ollowing key Container name:vs_key_****************

In this case, just follow the prompts to import the key, the specific steps are:

    1. Start the Visual Studio command prompt

      English: Starting with Microsoft Visual Studio 201*->visual studio Tools, Visual Studio command Prompt (201*)

      English:start, Visual Studio Tools, Developer Command Prompt for vs201*, Microsoft Visual Studio 201*

    2. Navigate to the directory where the. pfx file is located in the command prompt

    3. At the command prompt, entersn -i \*\*\*\*.pfx VS\_KEY\_\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

      For example:sn -i xxxx.pfx VS_KEY_791BAAE3DF288545

    4. Enter the password for the. PFX key file to complete the import

You should be able to build your project correctly in Visual Studio after you complete the import.

Re-import the key

Sometimes, when Visual Studio requires that you import a key and perform the above import step, you get the following error:

Failed to install key pair--Object already exists

You can then Visual Studio 命令提示 remove the imported key by executing the following command in to re-import:

sn -d VS\_KEY\_\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

After the key deletion is successful, the key can be re-imported through the above import steps.

If you get the following error when you delete the key:

Container does not exist

Container does not exist

This is due to the fact that another account in the system has already imported the key and cannot be removed from the current account. You can try to remove the key by logging in to the user account that you previously imported the key to, and then switch to the account where you want to build the project to re-import the key.

The solution that Visual Studio requires to import the PFX key and still require import after import

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.