Sometimes you have to sign with an existing key file building .NET project assembly through console msbuild.exe
There is manual way to import key file without installed Visual Studio.
MSBuild message:
Error MSB3325: Cannot import the following key file: keyfile.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_XXXXXXXXXXXXXXX.
Here is the solution:
- Check user has administrator rights from command line:
- Change dir to the keyfile.pfx directory.
- Execute the following tool with command:
> net localgroup Administrators
> sn.exe -i keyfile.pfx VS_KEY_XXXXXXXXXXXXXXX
sn.exe location example: %PROGRAMFILES%\Microsoft Visual Studio 8\SDK\v2.0\Bin