Cannot import the following key file fix
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>.