Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS - Error APPX0105: Cannot import the key file 'blah.pfx'. The key file may be password protected

This is a VSTS question and not to be confused with similar questions asked before. This application does not use strong name. I have a WIN RT legacy project and the certificate has run out. So I have a new one and I have set the password and put it in my project. However when I run the VSTS build I get the following error messages.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets (2557, 5) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2557,5): Error APPX0105: Cannot import the key file 'blah.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user's personal certificate store.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets (2557, 5) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2557,5): Error APPX0102: A certificate with thumbprint '11F4B2DBB13F0BDACAEA79617C76279AAB394592' that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets (2557, 5) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2557,5): Error APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478.

 Process 'msbuild.exe' exited with code '1'.

How do I fix this?

EDIT. I tried running the powershell command but I got this response; enter image description here

like image 632
arame3333 Avatar asked Mar 22 '18 16:03

arame3333


1 Answers

From the last error trace:

The certificate specified is not valid for signing

I expect that certificate is a self-signed certificate, in that case you can take a look on this Microsoft Documentation to Run the agent with self-signed certificate.


From the first error trace:

try to import the certificate manually into the current user's personal certificate store.

It is also possible that you did not install the certificate in the machine certificate store. please refer the the same link in that case.


You can doublecheck whether the certificate has been installed correctly by running this command:

PowerShell Invoke-WebRequest -Uri https://corp.tfs.com/tfs -UseDefaultCredentials

You may also get useful information on "Support Ssl Client Certificate in Build/Release Job" in this page

like image 108
A STEFANI Avatar answered Oct 13 '22 22:10

A STEFANI