This one has caused me a few hours of pain….a couple of times. It is about time I document how I fixed it.
Cannot import the following key file: <filename>.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_ E2AEBF22AB52DD08 <Application Name>
- Open Visual Studio Command Prompt (It can be found in the Windows Start menu)
- Type sn -i “c:\Pathtofile\<filename>.pfx” TVS_KEY_ E2AEBF22AB52DD08
- Reimport the pfx file into Visual Studio
The sn.exe with the –i parameter, installs a key pair from <infile> into a key container named <container>.
Other very easy solutions depending on cause:
– Change password of PFX to original password
– Import the file by right clicking and following the instructions
I’ve run into this a couple times as well. It never says VS_KEY for me. The solution that worked for me is right-clicking on the pfx and importing it with its password. Thanks for pointing that out, Markus.
Fine it works! Many thanks!
you saved my day! appreciated indeed
how to change the password and what is the original password?