Closed
Description
To reproduce this:
Create a new .NET Core console app with this in the .csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
</ItemGroup>
</Project>
Set the Program.cs
file to have the same code as shown in the "Getting Started" page: https://benchmarkdotnet.org/articles/guides/getting-started.html.
The key is the setting for <LangVersion>
. If I set it to a specific value, like 8.0
, the tests run as expected. If I set it to latest
, I get this error:
Standard error:
C:\Users\JasonB\source\repos\ConsoleApp35\ConsoleApp35\bin\Release\netcoreapp3.1\0192f748-6e76-46a0-a2b2-8204fb24ddc7\BenchmarkDotNet.Autogenerated.csproj(20,18): error MSB4086: A numeric comparison was attempted on "$(LangVersion)" that evaluates to "latest" instead of a number, in condition "'$(LangVersion)' == '' Or '$(LangVersion)' < '7.3'".
latest
and preview
values are valid, so this should not cause a problem.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
adamsitnik commentedon May 11, 2020
Hello @JasonBock
It's a bug that I've introduced in
0.12.1
and it was fixed in #1420 which is going to be part of next release.For now please set the
<LangVersion>
to a number or downgrade to0.12.0
.Thanks,
Adam