Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The "SignFile" task was not given a value for the required parameter "CertificateThumbprint"

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):

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.

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.

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).

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.


EDIT:

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

The build fails with the following message:

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.

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

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"

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


EDIT 3:

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.

But the TFS Build fails.

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)


EDIT 4:

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\ .

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.

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

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.

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.

I'm stuck here. Any ideas?

like image 582
Joel Avatar asked Dec 16 '14 15:12

Joel


1 Answers

Note: If you are looking for a quick fix and it is okay for your project to not be signed then you can do this. I encounter this problem when I am looking for a sample code, and using this quick fix solves my problem instantly.

  1. Go to the project properties
  2. Select signing options
  3. Uncheck the `Sign the ClickOnce manifests
  4. Save
  5. Re-run it
  6. (Optional) In some cases you need to rebuild it.

enter image description here

If it doesnt work please try to uncheck the enable ClickOnce security settings which can be located on Security tab.

enter image description here

like image 126
Cary Bondoc Avatar answered Sep 18 '22 18:09

Cary Bondoc