"SignFile"任务未获得所需参数"CertificateThumbprint"的值. [英] The "SignFile" task was not given a value for the required parameter "CertificateThumbprint"

查看:87
本文介绍了"SignFile"任务未获得所需参数"CertificateThumbprint"的值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个通过clickonce部署的业务应用程序.我可以构建和发布应用程序而没有任何问题,但是当我尝试使用持续集成(构建每个签入)时,出现以下错误:

We have a line of business app which is deployed via clickonce. I can build and publish the application without any problems but when I try to use Continuous Integration (Build each check-in) I get the following error:

 2>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5):

错误MSB4044: 没有为"SignFile"任务提供必需参数"CertificateThumbprint"的值.

error MSB4044: The "SignFile" task was not given a value for the required parameter "CertificateThumbprint".

[C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse \ Pulse.csproj]

[C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]

执行任务"SignFile"完成-失败.

Done executing task "SignFile" -- FAILED.

我们使用代码签名证书对应用程序(更具体地说:ClickOnce清单)进行签名,该证书已在AD中注册为Trusted Publisher.

We sign the application (to be more specific: the ClickOnce manifest) using a code signing certificate which is registered in the AD as Trusted Publisher.

证书存储在我的本地工作站上的证书存储中.证书也位于构建服务器的证书存储中(1.在个人存储中,2.在TFSBuildServiceHost服务帐户的个人存储中,以及3.在tfs/构建服务器本身的个人存储中.)

The Certificate is stored in Certificate store on my local workstation. The Certificate is also in the certificate store of the build server (1. In the Personal Store, 2. in the Personal store of the TFSBuildServiceHost Service Account and 3. in the Personal store of the tfs/build server itself).

在哪里使用Visual Studio 2013 Update 4,C#、. Net 4.5和TFS 2013 Update 4.

Where are using Visual Studio 2013 Update 4, C#, .Net 4.5 and TFS 2013 Update 4.

我不知道是什么原因导致此错误,我们将不胜感激.

I have no clue what causes this error, any help is appreciated.


我忘了提到几周前tfs构建工作正常.我没有做任何更改,我验证了项目文件(Pulse.csproj)尚未更改,并且我也使用该确切的Pulse.csproj文件/构建定义成功进行了一些构建.我很确定它一定是tfs服务器上的东西.我记得Microsoft在与证书基础结构有关的某些更新方面遇到了一些麻烦,是否可能与之相关?

I forgot to mention that the tfs build worked fine a few weeks ago. I didn't change a thing, i verified that the project file (Pulse.csproj) hasn't changed and i also had a few successful builds with that exact Pulse.csproj file / build definition. I'm pretty sure that it must be something on the tfs server. I remember that Microsoft had some trouble with some updates regarding the certificate infrastructure could it be related?


我试图使用以下命令通过命令行来构建项目:


EDIT 2: I tried to build the project via command line using this command:

"C:\ Program Files(x86)\ MSBuild \ 12.0 \ bin \ amd64 \ MSBuild.exe" C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse.sln

"C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe" C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln

构建失败,并显示以下消息:

The build fails with the following message:

CleanPublishFolder:删除目录"bin \ Debug \ app.publish \". _DeploymentComputeClickOnceManifestInfo:创建目录"bin \ Debug \ app.publish".
将文件从"obj \ Debug \ Pulse.exe"复制到 "bin \ Debug \ app.publish \ Pulse.exe". C:\ Program档案 (x86)\ MSBuild \ 12.0 \ bin \ amd64 \ Microsoft.Common.CurrentVersion.targets(3450,5): 错误MSB3482:登录时发生错误:SignTool.exe不 成立. [C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse \ Pulse.csproj] 完成的建筑项目 "C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse \ Pulse.csproj"(默认 目标)-失败.

CleanPublishFolder: Removing directory "bin\Debug\app.publish\". _DeploymentComputeClickOnceManifestInfo: Creating directory "bin\Debug\app.publish".
Copying file from "obj\Debug\Pulse.exe" to "bin\Debug\app.publish\Pulse.exe". C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB3482: An error occurred while signi ng: SignTool.exe not found. [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj] Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default targets) -- FAILED.

完成的建筑项目 "C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse.sln"(默认目标) -失败.

Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default targets) -- FAILED.

构建失败.

"C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse.sln"(默认目标) (1)->"C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse \ Pulse.csproj" (默认目标)(2)->(_DeploymentComputeClickOnceManifestInfo 目标)-> C:\ Program Files (x86)\ MSBuild \ 12.0 \ bin \ amd64 \ Microsoft.Common.CurrentVersion.targets(3450,5): 错误MSB3482:信号发生错误:SignTool.exe不 成立. [C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse \ Pulse.csproj]

"C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default target) (1) -> "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default target) (2) -> (_DeploymentComputeClickOnceManifestInfo target) -> C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB3482: An error occurred while sig ning: SignTool.exe not found. [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]

0 Warning(s)
1 Error(s)

服务器上确实存在Signtool. Signtool的路径为:"C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.1A \ Bin \ signtool.exe"和"C:\ Program Files \ Microsoft SDKs \ Windows \ v7.1 \ Bin \ signtool.exe"

The Signtool definitely exists on the Server. The path to the signtool is: "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" and "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe"

最有趣的部分是我可以使用其他msbuild工具来构建解决方案.

The most interesting part is that I CAN build the solution using a different msbuild tool.

"C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe" C:\ Builds \ 1 \ Pulse \ DefaultBuild \ src \ Pulse \ Pulse.sln

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln


我安装了适用于Windows 8的Windows软件开发工具包(SDK),现在我可以通过命令行构建解决方案.因此,安装了代码签名证书.可用.

I installed the Windows Software Development Kit (SDK) for Windows 8 and now I can build the solution via command line. Thus, the code signing certificate is installed & available.

但是TFS构建失败.

这是从tfsbuild日志文件收集的错误输出:

Here is the error output gathered from the tfsbuild logfile:

      Task "AL"
         C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\AL.exe /culture:de /out:obj\Debug\de\Pulse.resources.dll /platform:AnyCPU /template:obj\Debug\Pulse.exe /embed:obj\Debug\Pulse.View.Localization.CreditsView.de.resources /embed:obj\Debug\Pulse.View.Localization.PulseMainWindow.de.resources
         Microsoft (R) Assembly Linker version 12.0.20806.33440
         Copyright (C) Microsoft Corporation. All rights reserved.

       Done executing task "AL".
     2>Done building target "GenerateSatelliteAssemblies" in project "Pulse.csproj".
     2>Target "CreateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "CoreBuild" depends on it):
     2>Done building target "CreateSatelliteAssemblies" in project "Pulse.csproj".
       Target "SetWin32ManifestProperties" skipped. Previously built successfully.
       Target "_DeploymentComputeNativeManifestInfo" skipped, due to false condition; ('$(GenerateClickOnceManifests)'!='true') was evaluated as ('true'!='true').
     2>Target "CleanPublishFolder" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_DeploymentComputeClickOnceManifestInfo" depends on it):
       Task "RemoveDir" skipped, due to false condition; ('$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')) was evaluated as ('bin\Debug\app.publish\'=='bin\Debug\app.publish\' and Exists('bin\Debug\app.publish\')).
     2>Done building target "CleanPublishFolder" in project "Pulse.csproj".
       Target "_DeploymentGenerateTrustInfo" skipped, due to false condition; ('$(TargetZone)'!='') was evaluated as (''!='').
     2>Target "_DeploymentComputeClickOnceManifestInfo" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "GenerateApplicationManifest" depends on it):
       Task "Copy"
         Creating directory "bin\Debug\app.publish".
         Copying file from "obj\Debug\Pulse.exe" to "bin\Debug\app.publish\Pulse.exe".
       Done executing task "Copy".
       Using "SignFile" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "SignFile"
     2>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB4044: The "SignFile" task was not given a value for the required parameter "CertificateThumbprint". [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]
       Done executing task "SignFile" -- FAILED.
     2>Done building target "_DeploymentComputeClickOnceManifestInfo" in project "Pulse.csproj" -- FAILED.
     2>Target "_CheckForCompileOutputs" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
     2>Done building target "_CheckForCompileOutputs" in project "Pulse.csproj".
       Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).
     2>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_CleanRecordFileWrites" depends on it):
       Task "ReadLinesFromFile"
       Done executing task "ReadLinesFromFile".
       Task "ConvertToAbsolutePath"
       Done executing task "ConvertToAbsolutePath".
       Task "FindUnderPath"
         Comparison path is "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse".
       Done executing task "FindUnderPath".
       Task "FindUnderPath"
         Comparison path is "C:\Builds\1\Pulse\DefaultBuild\bin\".
       Done executing task "FindUnderPath".
       Task "FindUnderPath"
         Comparison path is "obj\Debug\".
       Done executing task "FindUnderPath".
       Task "RemoveDuplicates"
       Done executing task "RemoveDuplicates".
     2>Done building target "_CleanGetCurrentAndPriorFileWrites" in project "Pulse.csproj".
     2>Target "_CleanRecordFileWrites" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "CoreBuild" depends on it):
       Task "RemoveDuplicates"
       Done executing task "RemoveDuplicates".
       Task "MakeDir"
       Done executing task "MakeDir".
       Task "WriteLinesToFile"
       Done executing task "WriteLinesToFile".
     2>Done building target "_CleanRecordFileWrites" in project "Pulse.csproj".
     2>Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default targets) -- FAILED.
     1>Done executing task "MSBuild" -- FAILED.
     1>Done building target "Build" in project "Pulse.sln" -- FAILED.
     1>Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default targets) -- FAILED.

Build FAILED.

       "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default target) (1) ->
       "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default target) (2) ->
       (_DeploymentComputeClickOnceManifestInfo target) -> 
         C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB4044: The "SignFile" task was not given a value for the required parameter "CertificateThumbprint". [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]

    0 Warning(s)
    1 Error(s)


Visual Studio 2013未安装在我们的构建服务器上.我已经浏览过日志文件,发现TFS Build使用存储在C:\ Program Files(x86)\ MSBuild \ 12.0 \ bin \ amd64 \中的MSBuild.exe.

Visual Studio 2013 is not installed on our build server. I've already been through the logfile and found that the TFS Build uses the MSBuild.exe stored in C:\Program Files (x86)\MSBuild\12.0\bin\amd64\ .

由于我可以使用MSBuild.exe比TFS Build在生成服务器上生成项目,因此我可以确定证书本身不是问题.

Since I can build the project on the build server using the MSBuild.exe than TFS Build does I can be sure that the certificate itself is not an issue.

我在不修改任何设置的情况下创建了一个新的构建定义,但是我仍然收到相同的错误消息.

I created a new build definition without modifying any of the settings but I still get the same error message.

我还修复了构建服务器上的TFS安装,但是没有运气.

I also repaired the TFS Installation on the build server but no luck.

我将存储在服务器上C:\ Program Files(x86)\ MSBuild \ 12.0 \ bin \ amd64 \文件夹中的所有* .targets文件与客户端计算机上相同位置的* .targets文件进行了比较.那里100%完全相同.

I compared all *.targets files stored in the C:\Program Files (x86)\MSBuild\12.0\bin\amd64\ Folder on the Server with the *.targets files in the same location on my client machine. There 100% identical.

不用说,我可以在客户端计算机上构建项目而没有任何问题(通过VS2013和命令行).

Needless to say that I can build the project without any problems on my client machine (via VS2013 and command line).

我删除并重新注册/创建了构建服务/控制器/代理.结果仍然相同.

I deleted and re-registered/created the build service/controller/agent. The result is still the same.

我被困在这里.有什么想法吗?

推荐答案

这是我解决问题的方法:

This is how I solved the problem:

我们的构建服务被配置为以NT AUTHORITY\NetworkService身份运行,我只是将其更改为我自己的用户帐户.请注意,我已经将* .pfx文件安装到个人证书存储中.

Our build services was configured to run as NT AUTHORITY\NetworkService I simply changed this to my own user account. Note that I already had the *.pfx file installed to personal certificate store.

我猜问题是用户NT AUTHORITY\NetworkService在证书存储区中没有所需的证书.我仍然不知道如何将证书添加到系统帐户的个人存储中.尽管如此,尽管我不喜欢构建服务使用我的凭据运行这一事实,但我的问题暂时消失了.

I guess the problem was that the user NT AUTHORITY\NetworkService does not have the required certificate in the certificate store. I still have no idea how to add certificates into the personal store of system accounts. Nevertheless my problem is gone for now although I don't like the fact that the build service runs with my credentials.

这篇关于"SignFile"任务未获得所需参数"CertificateThumbprint"的值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆