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


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


错误MSB4044:
没有为“ SignFile”任务提供必需参数“ CertificateThumbprint”的值。

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

执行任务“ SignFile”完成-失败。


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

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

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

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


编辑:

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


编辑2:
我尝试使用以下命令通过命令行构建项目:


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


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


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”(默认
目标)-失败。

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

建立失败。

“ 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]

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”

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


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



编辑3:

我安装了Windows Software Development Kit (SDK) for Windows 8,现在可以通过命令行构建解决方案。因此,代码签名证书已安装且可用。

但是,TFS构建失败。

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

      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)



编辑4:

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

因为我可以使用MSBuild.exe而不是TFS Build在生成服务器上生成项目,所以我可以确定证书本身不是问题。

我创建了新的构建定义,而没有修改任何设置,但仍然收到相同的错误消息。

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

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

不用说,我可以在客户端计算机上毫无问题地构建项目(通过VS2013和命令行)。

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

我被困在这里。有任何想法吗?

最佳答案

注意:如果您正在寻找快速修复和it is okay for your project to not be signed,则可以执行此操作。我在寻找示例代码时遇到此问题,并且using this quick fix solves my problem instantly.


转到项目属性
选择签名选项
取消选中“签署ClickOnce清单”
保存
重新运行
(可选)在某些情况下,您需要重建它。


msbuild - 未为“SignFile”任务提供必需参数“CertificateThumbprint”的值-LMLPHP

如果不起作用,请尝试取消选中enable ClickOnce security settings选项卡上的Security

msbuild - 未为“SignFile”任务提供必需参数“CertificateThumbprint”的值-LMLPHP

关于msbuild - 未为“SignFile”任务提供必需参数“CertificateThumbprint”的值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27508421/

10-09 08:18