通过Jenkins运行MSBuild时,生成过程在签名过程中失败,如下所示:
C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\Build-EngineeringApps.proj(178,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /v /f "C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\certificate.pfx" /p [Password redacted] /t "http://timestamp.verisign.com/scripts/timstamp.dll" "C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\Setup\Release\setup.exe"" exited with code 255.
从开发人员命令提示符处运行MSBuild成功。从命令提示符处运行上述命令也成功。
如果从命令中删除了时间服务器,Jenkins将成功构建。即
C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\Build-EngineeringApps.proj(178,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /v /f "C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\certificate.pfx" /p [Password redacted] "C:\Program Files (x86)\Jenkins\workspace\engsoft\eng-software\Setup\Release\setup.exe"" exited with code 255.
jenkins服务被配置为在管理员帐户下运行。这是可以如上所述通过MSBuild成功构建的帐户。证书也已添加到该用户下的商店中。