Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket 5.214.0 gives 'error MSB4086: A numeric comparison was attempted...' #3610

Closed
aklefdal opened this issue Jul 3, 2019 · 5 comments
Closed

Comments

@aklefdal
Copy link

aklefdal commented Jul 3, 2019

Description

Paket 5.214.0 seems to have broken our build (restore), but only on the build server. Gets the following error message:

.paket\Paket.Restore.targets(77,169): error MSB4086: A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition " '$(MSBuildVersion)' < '16.0.360' ".

Repro steps

  1. Have a solution that works fine yesterday. Using Paket for dependencies, and Fake 5.15.1 or 5.15.2 for build scripts.
  2. Run a build after 5.214 is released

The builds scripts work fine on my machine, which has VS2019 installed. It works even in a standard command prompt. On the build agent, with .Net 4.7.2 developer pack installed, it fails.

Expected behavior

A working build.

Actual behavior

From the build log:

[Restore] PaketRestore: task: .
[12:14:51] : [PaketRestore] .> "C:\BuildAgent\work\7bdd66bf3bac5843.paket\paket.exe" restore (In: false, Out: false, Err: false)
[12:14:51] : [PaketRestore] Paket version 5.214.0
[12:14:51] : [PaketRestore] The last restore is still up to date. Nothing left to do.
[12:14:51] : [PaketRestore] Performance:
[12:14:51] : [PaketRestore] - Runtime: 142 milliseconds
[12:14:51]E: [Step 1/3] Build: target
[12:14:51]E: [Build] MSBuild: task: C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj
[12:14:51] : [MSBuild] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe "C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj" /t:Build /m /nodeReuse:False /v:m /clp:ForceConsoleColor /p:RestorePackages=True /p:OutputPath=C:%5CBuildAgent%5Cwork%5C7bdd66bf3bac5843%5Cbuild%5Cradio%5C /p:Configuration=Release "/bl:C:\BuildAgent\temp\buildTmp\tmp5924.tmp.binlog"
[12:14:51] : [MSBuild] C:\BuildAgent\work\7bdd66bf3bac5843> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" "C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj" /t:Build /m /nodeReuse:False /v:m /clp:ForceConsoleColor /p:RestorePackages=True /p:OutputPath=C:%5CBuildAgent%5Cwork%5C7bdd66bf3bac5843%5Cbuild%5Cradio%5C /p:Configuration=Release "/bl:C:\BuildAgent\temp\buildTmp\tmp5924.tmp.binlog" (In: false, Out: false, Err: false)
[12:14:51] : [MSBuild] Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
[12:14:51] : [MSBuild] Copyright (C) Microsoft Corporation. All rights reserved.
[12:14:51] : [MSBuild]
[12:14:51] : [MSBuild] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe /bl:C:\BuildAgent\temp\buildTmp\tmp5924.tmp.binlog /clp:ForceConsoleColor /m /nodeReuse:False /p:RestorePackages=True /p:OutputPath=C:%5CBuildAgent%5Cwork%5C7bdd66bf3bac5843%5Cbuild%5Cradio%5C /p:Configuration=Release /t:Build /v:m C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj
[12:14:51] : [MSBuild] [31;1mC:\BuildAgent\work\7bdd66bf3bac5843.paket\Paket.Restore.targets(77,169): error MSB4086: A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition " '$(MSBuildVersion)' < '16.0.360' ". [C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj]
[12:14:51] : [MSBuild] [m
[12:14:51]E: [MSBuild] : C:\BuildAgent\work\7bdd66bf3bac5843.paket\Paket.Restore.targets(77,169): error MSB4086: A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition " '$(MSBuildVersion)' < '16.0.360' ".

Known workarounds

Project files are the new SDK format, upgraded a few weeks ago, so we could now upgrade the build script to use Dotnet CLI instead.

@aklefdal
Copy link
Author

aklefdal commented Jul 3, 2019

I can confirm that using Dotnet Cli instead of Msbuild directly is a working solution for us.

@matthid
Copy link
Member

matthid commented Jul 3, 2019

@aklefdal I guess the VS2017 on the build server is not up to date but some older version?

@matthid
Copy link
Member

matthid commented Jul 3, 2019

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

  • Download Paket.Restore.targets from This PR
  • Replace .paket/Paket.Restore.targets in your repository
  • Set the PAKET_SKIP_RESTORE_TARGETS environment variable to true in your CI/locally (in order for Paket/Fake to not replace that file)
  • Re-run the build

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

@forki
Copy link
Member

forki commented Jul 3, 2019

can you please retry with 5.215.0?

@aklefdal
Copy link
Author

aklefdal commented Jul 4, 2019

I retried this morning, and can confirm that Paket 5.215 (with FAKE 5.15.3) works. You guys rock!

I will have a look at the instalment of build tools on the build agents, you are right, they might be outdated.

[08:40:23] : [MSBuild] [36;1m 3:2> [m [36;1mProject "C:\BuildAgent\work\7bdd66bf3bac5843\src\MYPROJECT\MYPROJECT.csproj" (3:2) is building "C:\BuildAgent\work\7bdd66bf3bac5843\src\MYOTHERPROJECT\MYOTHERPROJECT.csproj" (12:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
[08:40:23] : [MSBuild] [m [36;1m 12> [m [33;1mC:\BuildAgent\work\7bdd66bf3bac5843.paket\Paket.Restore.targets(134,5): warning : This version of MSBuild (we assume '15.0.0' or older) doesn't support GetFileHash, so paket fast restore is disabled. [C:\BuildAgent\work\7bdd66bf3bac5843\src\MYOTHERPROJECT\MYOTHERPROJECT.csproj]
[08:40:23] : [MSBuild] [m "C:\BuildAgent\work\7bdd66bf3bac5843.paket\paket.exe" restore
[08:40:23] : [MSBuild] Paket version 5.215.0
[08:40:23] : [MSBuild] The last restore is still up to date. Nothing left to do.
[08:40:23] : [MSBuild] Performance:
[08:40:23] : [MSBuild] - Runtime: 139 milliseconds

@aklefdal aklefdal closed this as completed Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants