A numeric comparison was attmepted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition "$(MSBuildVersion) >= 16.1.0")"

a numeric comparison was attempted on $(msbuildversion)'' that evaluates to '' instead of a number
a numeric comparison was attempted on lastknowntypescriptversion that evaluates to
a numeric comparison was attempted on $(_targetframeworkversionwithoutv)
a numeric comparison was attempted on $(targetplatformversion)
visual studio 2017 a numeric comparison was attempted on msbuildversion
a numeric comparison was attempted on msbuildassemblyversion that evaluates to instead of a number
a numeric comparison was attempted on visualstudioversion
in condition msbuildversion 16.1 0

I get this error when I try to reload my project that I had unloaded as shown in the screenshot below:

It says this line is from my Microsoft.Managed.Core.targets

  • I tried updating my NuGet packages.
  • I tried changing my Environment Variable path value to where msbuild.exe is located
  • I tried looking for a solution to change the Microsoft.Managed.Core.targets to ignore that check, but I don't think that is a good solution

Failure happens here. I believe this is the line that fails. Below is from my microsoft managed.core.targets

 <Import Project="Microsoft.Managed.EditorConfig.targets" Condition="$(MSBuildVersion) >= 16.1.0" /> 

This is from micrrosoft.managed.editorconfig.targets

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c)  Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information. -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <!-- Default this to false until the ".editorconfig in compiler" feature is no longer experimental.
         At that point this PropertyGroup can simply be deleted. -->
    <DiscoverEditorConfigFiles Condition="'$(DiscoverEditorConfigFiles)' == ''">false</DiscoverEditorConfigFiles>



  </PropertyGroup>

  <ItemGroup>
    <PotentialEditorConfigFiles Include="@(Compile->GetPathsOfAllDirectoriesAbove()->Combine('.editorconfig'))" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" />
    <EditorConfigFiles Include="@(PotentialEditorConfigFiles->Exists())" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" />
  </ItemGroup>


</Project>

The way I was able to fix this was by simply restarting Visual Studio

Error MSB4086: A numeric comparison was attempted on , 1\tools\Microsoft.Managed.Core.targets(63,60): Error MSB4086: A numeric comparison was attempted on “$(MSBuildVersion)” that evaluates to “”� Developer Community for Visual Studio Product family. This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use.

This is the same error that I'm getting as well.

A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition "$(MSBuildVersion) >= 16.1.0".

The way I resolved this was by going and checking for updates in Visual Studio and ensuring I had the latest version of visual studio.

From this site, Andy Gocke of Microsoft writes:

The Microsoft.Net.Compilers package requires newer versions of MSBuild as Visual Studio updates, so the 3.1.0 version requires MSBuild version 16.1.

Hope this helps!

error MSB4086: A numeric comparison was attempted on, For deployment issues, please provide us with the following information: Repro steps. your project built successfully on your dev machine but� A numeric comparison was attempted on "$ (_DeviceSdkVersion)" that evaluates to "" instead of a To Xamarin developers: When Visual studio deployment process stops with error A numeric comparison was attempted on "$ (_DeviceSdkVersion)" that evaluates to "" instead of a number, in condition "$ (_DeviceSdkVersion) >= 21".

Microsoft (MS) Build tool on your machine is not up-to-date. The Visual Studio (VS) 2017 Integrated Development Environment (IDE) on your machine is looking for MS build tool version 16.1.0. It is evident from the version number 16.1.0 in your error message. You should update VS 2017 to latest revision to update MS build tool to latest version. When you open VS Installer EXE on your machine then you'll see an Update button in the VS 2017 section if your Visual Studio install is not up-to-date as shown in the screenshot below:

Click on the Update button to update VS which will internally update MS build tool as well. Start Visual Studio after the completion of update setup. Open your solution again and reload the project which is currently unloaded. It should load fine now.

Fix: “A numeric comparison was attempted” at VS build (Costura , Fody: Error. A numeric comparison was attempted on "$(MsBuildMajorVersion)" that evaluates to "" instead of a number, in condition� a numeric comparison was attempted on "$ (msbuildversion)" that evaluates to "" instead of a number "$ (MSBuildVersion) >= 16.1.0". Closed - Not Enough Info visual studio 2017 version 15.5 windows 6.3 RJ Varona reported Jul 29, 2019 at 03:18 PM Greetings, I have no idea why this is happening.

A numeric comparison was attempted on , ReSharper 8.2 EAP Version=8.2.0.1139, Built=2014-03-04T06:24:38. A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to� Bugzilla – Bug 42168 A numeric comparison was attempted on "$(_DeviceSdkVersion)" that evaluates to "" instead of a number, in condition "$(_DeviceSdkVersion) >= 21". Last modified: 2016-08-03 18:50:00 UTC

error MSB4086: A numeric comparison was attempted on , TeamCity Addin 8.1 Version=8.0.102.476, Built=2013-12-03T01:37:32. From TeamCity Server: <unknown> build: <unknown> A numeric comparison was� A numeric comparison was attempted on "$ (TargetPlatformVersion)" that evaluates to "" instead of a number, in condition "'$ (TargetPlatformVersion)' > '8.0'" I searched around and some people reported getting this with ReSharper 8.2. I'm only on ReSharper 8.1 so I don't think that's the same issue.

a numeric comparison was attempted on "$(msbuildversion)" that , I am trying to build the project inside docker by using build.ps1 and I get this error . MSBuild auto-detection: using msbuild version '4.0' from� Created on 2017-11-06 11:17 by vstinner, last changed 2017-11-07 22:55 by vstinner.This issue is now closed.