VSTS Online - Build Solution With ClickOnce Signing PFX Password

后端 未结 1 1006
[愿得一人]
[愿得一人] 2021-01-03 04:44

I have a WPF Solution I am building in VSTS Online.

Below is my basic Build Definition:

In Visual Studio 2017 locally I\'ve assigned a Click Once Ce

相关标签:
1条回答
  • 2021-01-03 05:33

    Using this code to import certificate file (PowerShell task):

    $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()
    

    Related thread: Visual studio team services deploymen/buildt certificate error

    0 讨论(0)
提交回复
热议问题