Cannot import the following keyfile: blah.pfx. The keyfile may be password protected.

Posted by JasonD on Stack Overflow See other posts from Stack Overflow or by JasonD
Published on 2010-05-12T00:29:23Z Indexed on 2010/05/12 0:34 UTC
Read the original article Hit count: 1671

Filed under:
|
|

We just upgraded our Visual Studio 2008 projects to VS2010. All of our assemblies were strong signed using a Verisign code signing certificate. Since the upgrade we continuously get the following error:

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

This happens on some developer machines and not others. Some methods used to fix this that worked some of the time include:

  • re-installing the key file from Windows Explorer (right click on the PFX file and click Install)
  • installing VS2010 on a fresh machine for the first time prompts you for the password the first time you open the project, and then it works. On machines upgraded from VS2008, you don't get this option.

I've tried using the SN.EXE utility to register the key with the Strong Name CSP as the error message suggests, but whenever I run the tool with any options using the version that came with VS2010, SN.EXE just lists its command line arguments instead of doing anything. This happens regardless of what arguments I supply.

Does anyone know WHY this is happening, and have clear steps to fix it? I'm about to give up on Click Once installs and Microsoft Code Signing. Thanks for any help!

© Stack Overflow or respective owner

Related posts about VS2010

Related posts about PFX