1

When I am running the build from TFS server I got the following error: Cannot import the following key file: C:\TfsData\Build_work\fa450055\EXChecker 2015\signingKey.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_EFCA4C5B6DFD4B4F

Could anyone help out with that?

Ion Coliujco
  • 31
  • 1
  • 2

2 Answers2

9

It seems that your TFS Build Service account has no required permission to access the signingKey.pfx on build agent machine. Make sure you have this file on build agent machine first.

Then follow below steps:

  1. Log on the build agent as your local build service account (Better have Administrator permission)
  2. Open a visual studio command prompt and navigate to the directory the key is stored in
  3. Type command sn –i signingKey.pfx VS_KEY_EFCA4C5B6DFD4B4F(Ensure that you use the key name appearing in the error message)
  4. When prompted for a password type the password for the pfx file

  5. Then rebuild it

Note: If you are not running Visual Studio as an Administrator try doing that as well.

More details you can reference the answer from Brandon Manchester Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected'

Community
  • 1
  • 1
PatrickLu-MSFT
  • 44,639
  • 4
  • 24
  • 52
0

In my case, I did these steps and it worked successfully.

  1. Open the Team Foundation Server Administration console
  2. Click the XAML build configuration
  3. Click the build service properties
  4. Stop the service
  5. Change 'Run the service as a' — enter the user account and give the credentials of your own PC
  6. Start the service again
Nathan Tuggy
  • 2,239
  • 27
  • 28
  • 36