fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 520 forks source link

5.214: MSB4062: The "http://Microsoft.Build .Tasks.GetFileHash" task could not be loaded... #3609

Closed tih2010 closed 5 years ago

tih2010 commented 5 years ago

Description

Since V5.214 our project don't build anymore. Going back to V5.213 resolved the issues.

Repro steps

Shouldn't be hard to reproduce, but I can't provide my code and environment :-)

Expected behavior

Build works.

Actual behavior

We get tons of messages like the one in the picture (sorry, I don't have it as text anymore)

image

Seems some component is hard bound to Microsoft.Build .Tasks.Core.dll V 15.1.0.0

Known workarounds

Going back to V5.213

matthid commented 5 years ago

Yes what environment are you using (Visual Studio / Dotnet SDK version)?

matthid commented 5 years ago

To explain: We are using a new msbuild Task in 5.214 but only in the targets file for .NET SDK which is at least msbuild 15.8 as far as I know (where the task was introduced). Therefore it should have been safe to add this dependency. Question is why it fails for you. Are you building new SDK project with an old msbuild version?

tih2010 commented 5 years ago

We are using VS2019 (and VS Code) during development, I don't know if that matters a lot.

For our complete build we use a script featuring yarn, paket and fake.

The code itself is written in C# and F#, using '.net standard2.0' and '.net core 2.1'

As far as I understand we are using SDK 2.1. With it came msbuild 15.7.179.6572 (as I see in the logs)

I'll attach a file with the complete output of our build-process with Paket 5.213:

build_paket5_213.txt

Do you need another one fpr a run with Paket 5.214? It wouldn't be very long. :-)

Starting task 'DotNet:build': D:\Rhein-Spree\OnfitCode\OnlineDPR\src\OnlineDPR.Application
D:\Rhein-Spree\OnfitCode\OnlineDPR> "C:\Program Files\dotnet\dotnet.EXE" msbuild /version /nologo (In: false, Out: true, Err: true)
15.7.179.6572
D:\Rhein-Spree\OnfitCode\OnlineDPR> "C:\Program Files\dotnet\dotnet.EXE" build "D:\Rhein-Spree\OnfitCode\OnlineDPR\src\OnlineDPR.Application" --configuration Debug /nodeReuse:False "/bl:C:\Users\Wob\AppData\Local\Temp\tmp7361.tmp.binlog" (In: false, Out: false, Err: false)
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\dotnet\sdk\2.1.302\MSBuild.dll -consoleloggerparameters:Summary -distributedlogger:Microsoft....
matthid commented 5 years ago

If you want to test a fix (or have a workaround):

Otherwise wait for the PR to be released and report back.

forki commented 5 years ago

can you please retry with 5.215.0?

tih2010 commented 5 years ago

Yes! It's working again! That was quick, thanks a lot.

We especially take the line "\Paket.Restore.targets(134,5): warning : This version of MSBuild (we assume '15.7.179' or older) doesn't support GetFileHash, so paket fast restore is disabled." as a personal greeting :-)

(And will switch to a newer version soon)