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
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 microsoft.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
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With