Error: "Cannot import the following key file: mykey.pfx. The key file may be password protected." in Microsoft Visual Studio 2008 or 2010

Solution ID:    SO22628    Updated:    05/02/2016

Problem

The following error occurs when building projects for Microsoft Visual Studio 2008 or 2010.

Error: "Cannot import the following key file: mykey.pfx. The key file may be password protected."

Cannot import the following key file: mykey.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_C1D3ACB8FBF1AGK4
 

Cause

Microsoft bug in Visual Studio.

Solution

To resolve this issue from Microsoft Visual Studio 2008 or 2010, perform the following steps.

To open the Visual Studio Command Prompt window

If you have Visual Studio 2005 or later installed on your computer, you can use the Visual Studio Command Prompt to run the tools:

  1. Click Start > All Programs > Microsoft Visual Studio >Visual Studio Tools > Visual Studio Command Prompt.

  2. Type the following command

    sn -i "c:\Pathtofile\.pfx" VS_KEY_C1D3ACB8FBF1AGK4

    Note:  The sn.exe with the -i parameter, installs a key pair from into a key container named.
     
  3. Re-import the pfx file into Visual Studio.


If the suggested resolution steps above unable to fix the issue with Microsoft Visual Studio 2008 or 2010. You may visit the following internet forums for other workarounds. Please contact Microsoft support for further assistance.

 

Disclaimer:

Terms of use for this information are found in Legal Notices

Contact Support

Find Answers