Are there any way to Sign Clickonce application when building with TFS online services?

老子叫甜甜 提交于 2020-01-24 05:14:11

问题


I have enabled signing in my click once application.

But the build server (TFS online services) do not have the certificate. Is there any way I can include the certificate in the repositiory and make the build server sign it or do I have to disable signing and do it manually after?

Instead of picking a cert from the store I checked in a file and picked from file instead.

Build server then gives me:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (2482): Cannot import the following key file: . 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.

(is it intended that I should check one in without the password and is that what others do? is it not dangerous to have private keys out there with no password.)


回答1:


I created the following powershell script in the repository:

 [CmdletBinding()]
 param(
     [Parameter(Mandatory=$True)]
     [string]$signCertPassword
    )

$SecurePassword = $signCertPassword | ConvertTo-SecureString -AsPlainText -Force
Write-Output "Importing pfx"

Import-PfxCertificate -FilePath "YourPfxFile.pfx" -Password $SecurePassword Cert:\CurrentUser\My

and passed the password as a variable (locked)




回答2:


I created CodeActivites for using Mage.exe and Signtool.exe and build the signing into my build template instead.

From /t:publish all files had .deploy extension and I had to create a XML Task that updates the manifest xml to support this.



来源:https://stackoverflow.com/questions/20590086/are-there-any-way-to-sign-clickonce-application-when-building-with-tfs-online-se

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!