我有一個clickonce解決方案,適用於安裝了VS 2015的多個開發人員計算機。但是,它不適用於我們的buildserver,它帶有這個signFile錯誤。我已經安裝了錯誤MSB4018:構建服務器上的「SignFile」任務意外失敗
- 生成工具2015年更新3
- 淨4.6.2 SDK
- Windows軟件開發工具包
但apparantly的路徑signtool.exe沒有正確設置。如果我禁用清單的簽名,它將繼續,但會出現setup.bin丟失的錯誤。
有沒有人有一個很好的線索如何解決SignFile問題?
[_DeploymentComputeClickOnceManifestInfo] Using "SignFile" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
[_DeploymentComputeClickOnceManifestInfo] SignFile
[SignFile] C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3616, 5): error MSB4018: The "SignFile" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: path1
at System.IO.Path.Combine(String path1, String path2, String path3)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.GetPathToTool(ResourceManager resources)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignPEFile(X509Certificate2 cert, Uri timestampUrl, String path, ResourceManager resources, Boolean useSha256)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFileInternal(X509Certificate2 cert, Uri timestampUrl, String path, Boolean targetFrameworkSupportsSha256, ResourceManager resources)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFile(X509Certificate2 cert, Uri timestampUrl, String path)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFile(String certThumbprint, Uri timestampUrl, String path, String targetFrameworkVersion)
at Microsoft.Build.Tasks.SignFile.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
我不知道你是怎麼想出來的,但是謝謝。你有沒有機會知道它依賴於哪個SDK,所以我不需要全部安裝?現在我通過在調用msbuild時設置屬性/屬性:TargetFrameworkSDKToolsDirectory來規避此問題。 –
回覆更新了這個信息(我希望我是對的!)。至於我如何解決這個問題,我首先找到錯誤日誌頂部附近引用的文件和行號。當我看到'SignFile'任務沒有爲工具/可執行文件的路徑添加參數時,我知道我需要查看'SignFile'任務的源代碼。幸運的是,MSBuild現在是開源的! – weir
@dennis_ler - 我已將您的'TargetFrameworkSDKToolsDirectory'修復程序添加到此答案。 – weir