VSTS - Error APPX0105: Cannot import the key file "blah.pfx". Key file can be password protected

This is a VSTS question and not to be confused with similar questions asked earlier. This application does not use a strong name. I have an outdated WIN RT project and the certificate has expired. So, I have a new one, and I set a 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 key file 'Blah.pfx. The key file can be password protected. To fix this, try importing the certificate manually into the user's current 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: fingerprint certificate '11F4B2DBB13F0BDACAEA79617C76279AAB394592' that was specified in the project could not be found in the certificate store. Please indicate a valid fingerprint 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 specified certificate is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478 .

 The process "msbuild.exe" has completed with the code "1".

How to fix it?

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

+5
source share
1 answer

From the last error trace:

The specified certificate is not valid for signing.

I expect the certificate to be a self-signed certificate , in which case you can take a look at this Microsoft documentation. Run the agent with a self-signed certificate.


From the first error trace:

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

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


You can double-check that the certificate is installed correctly by running this command:

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

You can also get useful information about the "Ssl Support Client Certificate in Build / Release Job" on this page.

+2
source

Source: https://habr.com/ru/post/1276024/


All Articles