-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LangVersion computation on non-English locales #76070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this related to the bug on MSBuild side?
Yes, that looks related. Thanks for the link. |
@@ -20,7 +20,7 @@ | |||
to determine the correct language version. | |||
--> | |||
<_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND | |||
'$(_MaxSupportedLangVersion)' == ''">$([MSBuild]::Add(9, $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV), 5)))).0</_MaxSupportedLangVersion> | |||
'$(_MaxSupportedLangVersion)' == ''">$([MSBuild]::Add(9, $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV.Split('.')[0]), 5)))).0</_MaxSupportedLangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment that points to the msbuild issue about localization?
Fixes failing Spanish leg in roslyn-CI after #75795.
Given
$(_TargetFrameworkVersionWithoutV)
=5.0
, the subtraction$([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV), 5))
evaluates to45
(I guess because the period in5.0
is not interpreted as decimal separator but as thousands separator instead). Adding.Split('.')[0]
makes sure only the major version is taken and the subtraction works.