Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS build error certificate to the Strong Name CSP

Tags:

tfs

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?

like image 836
Ion Coliujco Avatar asked Jan 25 '26 10:01

Ion Coliujco


1 Answers

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'

like image 164
PatrickLu-MSFT Avatar answered Jan 28 '26 06:01

PatrickLu-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!