Uh oh!
There was an error while loading. Please reload this page.
Fix Time Zone when running with Globalization Invariant Mode - #59710
Conversation
ghost
commented
Sep 28, 2021
Tagging subscribers to this area: @tarekgh, @safern Issue DetailsWhen enabling the globalization invariant mode on Linux, we'll always fallback to In .NET 6.0 we have introduced the Globalization Invariant Mode Breaking Change. This breaking change causes throwing exception when enabling the globalization invariant mode and creating any culture other than Invariant culture. The fix is simple and not risky which is avoid creating any culture during time zone initialization when the globalization invariant mode is on.
|
ghost
commented
Sep 28, 2021
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsWhen enabling the globalization invariant mode on Linux, we'll always fallback to In .NET 6.0 we have introduced the Globalization Invariant Mode Breaking Change. This breaking change causes throwing exception when enabling the globalization invariant mode and creating any culture other than Invariant culture. The fix is simple and not risky which is avoid creating any culture during time zone initialization when the globalization invariant mode is on.
|
Uh oh!
There was an error while loading. Please reload this page.
tarekgh
commented
Sep 28, 2021
Thanks for reminding using it. |
Uh oh!
There was an error while loading. Please reload this page.
danmoseley
commented
Sep 28, 2021
I support taking this. Please send tactics mail when ready. |
tarekgh
commented
Sep 28, 2021
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1284491644 |
Uh oh!
There was an error while loading. Please reload this page.
#59636
When enabling the globalization invariant mode on Linux, we'll always fallback to
UTCtime zone which is wrong and a regression from .NET 5.0. We have some docker containers (e.g. Alpine) which enable the globalization invariant mode by default on the whole image; the problem will be obvious there.In .NET 6.0 we have introduced the Globalization Invariant Mode Breaking Change. This breaking change causes throwing exception when enabling the globalization invariant mode and creating any culture other than Invariant culture.
If the globalization invariant mode is enabled and trying to get the local time zone when running on Linux platform, the creation process will try to initialize the display names of the time zone. This initialization tries to reset the UI culture to
en-USif it is set to Invariant culture. When we have the globalization invariant mode is on, the UI culture will always be Invariant and cause the time zone initialization to fallback toen-USwhich will throw exception because it is not allowed to create any other cultures in the Invariant mode. We catch the exception and then fallback to useUTCtime zone instead of the actual time zone set on the running machine.The fix is simple and not risky which is avoid creating any culture during time zone initialization when the globalization invariant mode is on.