Skip to content

Commit

Permalink
Fix warning level calculation for .NET 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 authored Dec 4, 2024
1 parent 257517e commit cc259b5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- The CSharp.props used to hard-code WarningLevel to 4, so to maintain parity with .NET Framework projects we do that here. -->
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETFramework' ">4</WarningLevel>
<!-- .NET projects, however, can float up to their TFM's major version -->
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">$(_TargetFrameworkVersionWithoutV.Substring(0, 1))</WarningLevel>
<WarningLevel Condition="'$(Language)' == 'C#' And '$(WarningLevel)' == '' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">$(_TargetFrameworkVersionWithoutV.Split('.')[0])</WarningLevel>
</PropertyGroup>

<!-- Enable Analyzers based on EffectiveAnalysisLevel -->
Expand Down

0 comments on commit cc259b5

Please sign in to comment.