[Fix] “Cannot Import The Following Key File” In VB.NET

Today we are going to share a fix for VB.NET users which are encountering the error “Cannot import the following key file“. When you build your project, following error will be shown:

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_XXXX

The error is caused since Visual Studio is unable to access the file. So we will again give Visual Studio the key file here:

1. Open the project properties using Project -> [Project Name] Properties.

2. Go to Signing tab.

3. As highlighted in above image, re-select the key from combo-box. It will ask you for a password and the error will be gone.

4. If you receive any error, just ignore it. If it still doesn’t work, click Change Password button which is after the combo-box.

This fix applies to VS 2008, 2010, 2012 and some higher versions.

Join Us On Facebook and Twitter and you can subscribe via email too

Related posts