title: Visual studio team services deploymen/buildt certificate error
body: <p>I am trying to build a click-once application using the Continuous integration and deployment feature in VSTS (Visual studio team services Online)We are trying to build this using the Hosted agent Visual studio 2015 We had difficulties signing the strong name key file with an error of </p>
  
  <p><code>MSB3326: Cannot import the following key file: xxxx.snk. The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user's personal certificate store.</code>
  And after that </p>
  
  <p><code>MSB3321: Importing key file "xxxx.pfx" was canceled.</code></p>
  
  <p>I have tried to both select from store and from file changed the location and made sure to commit but with no success.
  Any ideas how i can overcome this errors or what am doing wrong.</p>
  
  <p><strong>Clerification on answer selected</strong></p>
  
  <p>Just wanted to make a clarification if anyone else has the same issue, in addition to the answer i had to place my certificate in my source control code and commit it. Then to select its location add a global variable on the VSTS Build</p>
  
  <p><a href="https://i.stack.imgur.com/cmT37.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cmT37.png" alt="enter image description here"></a></p>
  
  <p><code>$cert.Import("$(CertPath)", $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")</code>
  Where $(CertPath) would be something like <code>$(Build.SourcesDirectory)\SharedSolutionFiles\CertificateName.pfx</code></p>