Skip to content

Commit 82b15ee

Browse files
Fix MSB4086 if LangVersion is a keyword (#1420)
Fix compilation error MSB4086 if LangVersion is already set to one of the keywords such as preview, latest and latestMajor. Otherwise MSBuild complains that it cannot perform a numeric comparison.
1 parent 742f44f commit 82b15ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BenchmarkDotNet/Templates/CsProj.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
1818
$COPIEDSETTINGS$
1919
<!-- we set LangVersion after $COPIEDSETTINGS$ which might contain LangVersion copied from the benchmarks project -->
20-
<LangVersion Condition="'$(LangVersion)' == '' Or '$(LangVersion)' &lt; '7.3'">latest</LangVersion>
20+
<LangVersion Condition="'$(LangVersion)' == '' Or ($([System.Char]::IsDigit('$(LangVersion)', 0)) And '$(LangVersion)' &lt; '7.3')">latest</LangVersion>
2121
</PropertyGroup>
2222

2323
<ItemGroup>

0 commit comments

Comments
 (0)