Skip to content
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 crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode #8738

Merged
merged 1 commit into from
May 10, 2023

Conversation

mfilippov
Copy link
Contributor

Context

If DOTNET_SYSTEM_GLOBALIZATION_INVARIANT is enabled and console codepage non-ANSI MSBuild will crash on an attempt to create CultureInfo:

Unhandled exception. System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en-US is an invalid culture identifier.

Changes Made

Keep the current thread culture the same if CurrentUICulture is Invariant.

@JanKrivanek
Copy link
Member

FYI @nagilson (currently touching the MSBuild i18n in #8503)

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks!

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not remember all the subtleties here but this looks like it's good to me.

@nagilson
Copy link
Member

nagilson commented May 9, 2023

FYI @nagilson (currently touching the MSBuild i18n in #8503)

Thanks for the ping, this shouldnt have any conflicts or issues with that change to my expectation

@JanKrivanek JanKrivanek added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label May 10, 2023
@JaynieBai JaynieBai merged commit 7f4bef8 into dotnet:main May 10, 2023
@mfilippov mfilippov deleted the mf-crash-fix branch May 10, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants