Skip to content

Commit 847f894

Browse files
authored
Probably better approach
1 parent cc259b5 commit 847f894

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Copyright (c) .NET Foundation. All rights reserved.
6262
<!-- The CSharp.props used to hard-code WarningLevel to 4, so to maintain parity with .NET Framework projects we do that here. -->
6363
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETFramework' ">4</WarningLevel>
6464
<!-- .NET projects, however, can float up to their TFM's major version -->
65-
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">$(_TargetFrameworkVersionWithoutV.Split('.')[0])</WarningLevel>
65+
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">$([System.Version]::Parse('$(_TargetFrameworkVersionWithoutV)').Major</WarningLevel>
6666
</PropertyGroup>
6767

6868
<!-- Enable Analyzers based on EffectiveAnalysisLevel -->

0 commit comments

Comments
 (0)