Skip to content

Commit

Permalink
Update Microsoft.CSharp.Core.targets
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperk81 authored Nov 7, 2024
1 parent 99dcfb8 commit fb76caf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Compilers/Core/MSBuildTask/Microsoft.CSharp.Core.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
<!-- .NETCoreApp < 3.0, .NETStandard < 2.1, or any other target framework -->
<_MaxSupportedLangVersion Condition="('$(TargetFrameworkIdentifier)' != '.NETCoreApp' OR '$(_TargetFrameworkVersionWithoutV)' &lt; '3.0') AND
('$(TargetFrameworkIdentifier)' != '.NETStandard' OR '$(_TargetFrameworkVersionWithoutV)' &lt; '2.1')">7.3</_MaxSupportedLangVersion>


<!-- .NETCoreApp < 5.0, .NETStandard == 2.1 -->
<_MaxSupportedLangVersion Condition="(('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' &lt; '5.0') OR
('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' == '2.1')) AND
'$(_MaxSupportedLangVersion)' == ''">8.0</_MaxSupportedLangVersion>

<!--
Set the base language version for .NET 5.0.
Based on the empirical pattern, each major .NET version release supports
Expand All @@ -28,7 +33,7 @@
- Adds this difference to the base language version (9) to dynamically determine the correct language version.
This approach follows the observed pattern and ensures scalability for future versions.
-->
<_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_MaxSupportedLangVersion)' == '' AND '$(_TargetFrameworkVersionWithoutV)' != ''">
<_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_MaxSupportedLangVersion)' == ''">
$([MSBuild]::Add($(_BaseLangVersion), $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV)), 5))))
</_MaxSupportedLangVersion>

Expand Down

0 comments on commit fb76caf

Please sign in to comment.