0

I am doing a VSTS build.It is running perfectly in my machine but when we try to run it in the build server it is getting struck into one step:"deleting .manifest.pregam" and after that build will get terminated after the buffer time.We are suspecting that this maybe the problem because of the certificate installation in the build machine as in log files it showing that the build is waiting for the "Signfile".Can anyone here suggest me how to overcome this hurdle?your suggestions will be appreciated.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Hi and welcome to Stack Overflow, please take a time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way around here (and also to earn your first badge), read how to create a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and also check [How to Ask Good Questions](https://stackoverflow.com/help/how-to-ask) so you increase your chances to get feedback and useful answers. – DarkCygnus Jul 20 '17 at 15:50

1 Answers1

0

You need to import the certificate file (e.g. pfx) before Visual Studio Build step.

  1. PowerShell task to build definition. Working folder:[certificate file path]

Script:

$pfxpath = 'pathtoees.pfx'
$password = 'password'
Add-Type -AssemblyName System.Security
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")
$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "MY", CurrentUser
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
$store.Add($cert)
$store.Close()
  1. Visual Studio Build task

A related thread: Visual studio team services deploymen/buildt certificate error

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • Hi,Thanks for your response.But the thing is that certificate is already imported in the build server and then also i am getting this error. – Lucky Agarwal Jul 24 '17 at 06:48
  • Could you share the detail build log on the OneDrive? – starian chen-MSFT Jul 24 '17 at 06:53
  • Hi all,The problem is resolved.Actually the pfx certificate was installed using secure settings.So everytime the build runs it prompts for password which can be done as it is an automatic build.So we uninstalled the previous certificate and installed the new certificate by unchecking the added security one option. Thanks for all your support – Lucky Agarwal Jul 25 '17 at 08:11