Unable to build the assembly:
C: \ Program Files (x86) \ MSBuild \ 12.0 \ bin \ amd64 \
Microsoft.Common.CurrentVersion.targets (2696): Cannot import the following key file:
MyKey.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_977DBD18D1081093
I have read many posts, but none of them helped me. How can I install the certificate if I physically do not have access to the server and I can not call the command sn.
Start Windows Explorer and select and hold (or right-click) the . pfx file, then select Open to open the Certificate Import Wizard. Follow the procedure in the Certificate Import Wizard to import the code-signing certificate into the Personal certificate store.
pfx” file that contains the certificate(s) and private key. Open Microsoft Management Console (MMC). In the Console Root expand Certificates (Local Computer). Your server certificate will be located in the Personal or Web Server sub-folder.
A PFX file indicates a certificate in PKCS#12 format; it contains the certificate, the intermediate authority certificate necessary for the trustworthiness of the certificate, and the private key to the certificate. Think of it as an archive that stores everything you need to deploy a certificate.
Hi Use powershell script to do this ,
I also faced the same issue , but if physical access is not there , application access or script execution access should be there other wise it is not possible
First create passoword
Import-PfxCertificate -FilePath "yourfile.pfx" -Password $yourPassword Cert:certificateLocation
Also if you have build service account then
Logon to the build machine using the build service account
Run msbuild on any project that uses this signing key. It will prompt for the password and will export the key.
Now start the TeamBuild full build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With