You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Check for Windows NLS vs. ICU behavior differences in Globalization tests #6034
When ICU is missing on Linux, Globalization Invariant Mode is disabled, and you try to use globalization features, the .NET Runtime throws an exception.
This is intentional. The windows build of .NET works on older OSes where ICU is absent and our customers expect it to use NLS.
I guess you're saying you'd prefer that we would have made it more breaking by not falling back to NLS on an OS version where we expect ICU to be present, unless the customer specifically told us to use NLS with the switch?
I guess you're saying you'd prefer that we would have made it more breaking by not falling back to NLS on an OS version where we expect NLS to be present, unless the customer specifically told us to use NLS with the switch?
Can you clarify if this is even a supported/tested scenario? e.g. NLS fallback on an modern OS like nanoserver 2025 where the globalization FOD is not installed by default?
Behavior when using globalization features: This title needs some clarification, particularly when Globalization Invariant mode is enabled.
When using the Invariant culture and the Invariant mode is on, most scenarios will not throw exceptions but will exhibit specific behaviors. For instance, string comparisons will be ordinal rather than linguistic. Additional details about Invariant mode can be found in the documentation.
When other cultures are used when Invariant mode is on, an exception is typically expected by default. However, this behavior can be adjusted with a configuration switch that allows the creation of any culture, though all created cultures will still behave like the Invariant culture.
On Windows systems: Even when ICU is available and Invariant mode is turned off, users can switch to NLS by setting the appropriate configuration switch.
App-local ICU: Apps have the option to use ICU app-local, enabling them to manage globalization independently from the OS by carrying their own version of ICU.
The only scenario that is not supported which you called it misconfiguration is when ICU is missing on non-Windows platforms and the Invariant mode is not enabled.
Can you clarify if this is even a supported/tested scenario? e.g. NLS fallback on an modern OS like nanoserver 2025 where the globalization FOD is not installed by default?
.NET ensures that applications follow OS behavior. So, if ICU is available on Windows, the app will use ICU by default. If ICU is not present, the app will revert to the default globalization behavior, similar to native applications.
Some clarification, on nanoserver 2025 I didn't check if NLS APIs will still be available to call and only trimming the data. I'll try to find out that.
I guess you're saying you'd prefer that we would have made it more breaking by not falling back to NLS on an OS version where we expect ICU to be present, unless the customer specifically told us to use NLS with the switch?
If that's the case, then yes that's the question we're asking. If ICU is the forward-looking globalization approach for Windows, then we are wondering if we should reconsider the Runtime's behavior for this scenario (for new Windows versions). I think all other Windows versions since ICU was added all have ICU. Except now NanoServer 2025.
We are inclined to turn globalization invariant mode on by default for this image, so that we avoid users sliently encountering breaking changes when migrating from NanoServer 2022 to 2025 images and not realizing they're using NLS. Then we would provide instructions for installing ICU and enabling globalization.
Let's assume we ship images w/o ICU installed and w/o GIVM enabled. Do we need to warn or just inform users about this choice? That's the key question.
Yes! That's one of the options and is my preference. We need to find out the size impact for that.
It would be good to get an answer to the question I asked. Some of this thread is operating on the premise that NLS behavior is different/worse and that we'd need to warn people about that. I want to determine if that is true.
@richlander is the ask here then to more generally validate the entire runtime on Nano Server 2025? I've lost track of the next steps since this started as a specific globalization issue, but now it seems broader. I'd like to make sure we're on the same page and not repeating efforts others are already doing, or putting in more resources to this specific case than we do for other platforms.
The best way to scout these things is if we have a helix queue to add work to - we can then schedule a build sending work to that queue.
We can produce Nano Server 2025 Helix container images from buildtools-prereqs, but it won't matter if we don't have a Server Core 2025 queue to run them on, if I understand correctly how Helix works.
How are folks testing on Server Core 2025 right now? Just building locally and running tests? VMs? Any instructions that could be shared - maybe we can get someone to scout the library tests.
We are running the .NET Docker tests which aren't very comprehensive. I don't know any other teams that are running tests on 2025. There is one 2025 ARM queue for some reason. But no AMD64: dotnet/dnceng#3343.
I proposed in my PR that we ship the nightly .NET images now to better facilitate testing while we wait on Helix queues. These images are functional, but we just want to understand the nuances of the globalization changes better. #5944
but we just want to understand the nuances of the globalization changes better.
I already talked to Windows team and the behavior should be clear now. nano-server 2025 will work as nano-server-2022 which will use NLS. Both are not installing ICU till now. Only changes can be noticed when Windows updates the locale data, which usually happens almost with every release. Let me know if you have any more questions regarding globalization I can help with.
Thanks. I think that is good enough. We have been so used to ICU at this point, that an NLS scenario seemed unique and different. Seems like we should move forward treating this as just another version upgrade.
Thanks for reaching out to the Windows team and helping us better understand the situation.
.NET images for Server 2025 are now published from our nightly branch (not supported for production yet). Can @tarekgh or @ericstj do any testing with these images to validate @tarekgh's claims here?
Activity
ericstj commentedon Nov 14, 2024
@tarekgh to weigh in,
This is intentional. The windows build of .NET works on older OSes where ICU is absent and our customers expect it to use NLS.
I guess you're saying you'd prefer that we would have made it more breaking by not falling back to NLS on an OS version where we expect ICU to be present, unless the customer specifically told us to use NLS with the switch?
MichaelSimons commentedon Nov 14, 2024
Can you clarify if this is even a supported/tested scenario? e.g. NLS fallback on an modern OS like nanoserver 2025 where the globalization FOD is not installed by default?
tarekgh commentedon Nov 14, 2024
Comments on the table above:
Behavior when using globalization features: This title needs some clarification, particularly when Globalization Invariant mode is enabled.
On Windows systems: Even when ICU is available and Invariant mode is turned off, users can switch to NLS by setting the appropriate configuration switch.
App-local ICU: Apps have the option to use ICU app-local, enabling them to manage globalization independently from the OS by carrying their own version of ICU.
The only scenario that is not supported which you called it
misconfigurationis when ICU is missing on non-Windows platforms and the Invariant mode is not enabled..NET ensures that applications follow OS behavior. So, if ICU is available on Windows, the app will use ICU by default. If ICU is not present, the app will revert to the default globalization behavior, similar to native applications.
tarekgh commentedon Nov 14, 2024
Some clarification, on
nanoserver 2025I didn't check if NLS APIs will still be available to call and only trimming the data. I'll try to find out that.lbussell commentedon Nov 14, 2024
@ericstj I think you meant:
If that's the case, then yes that's the question we're asking. If ICU is the forward-looking globalization approach for Windows, then we are wondering if we should reconsider the Runtime's behavior for this scenario (for new Windows versions). I think all other Windows versions since ICU was added all have ICU. Except now NanoServer 2025.
We are inclined to turn globalization invariant mode on by default for this image, so that we avoid users sliently encountering breaking changes when migrating from NanoServer 2022 to 2025 images and not realizing they're using NLS. Then we would provide instructions for installing ICU and enabling globalization.
richlander commentedon Nov 15, 2024
Let's assume we ship images w/o ICU installed and w/o GIVM enabled. Do we need to warn or just inform users about this choice? That's the key question.
tarekgh commentedon Nov 15, 2024
Do we have the option to install ICU on such image?
richlander commentedon Nov 15, 2024
Yes! That's one of the options and is my preference. We need to find out the size impact for that.
It would be good to get an answer to the question I asked. Some of this thread is operating on the premise that NLS behavior is different/worse and that we'd need to warn people about that. I want to determine if that is true.
16 remaining items
lbussell commentedon Nov 22, 2024
This will be blocked on Add Windows 2025 support to Helix (dotnet/dnceng#4170).
We can produce Nano Server 2025 Helix container images from buildtools-prereqs, but it won't matter if we don't have a Server Core 2025 queue to run them on, if I understand correctly how Helix works.
/cc @ilyas1974
ericstj commentedon Nov 22, 2024
How are folks testing on Server Core 2025 right now? Just building locally and running tests? VMs? Any instructions that could be shared - maybe we can get someone to scout the library tests.
lbussell commentedon Nov 22, 2024
We are running the .NET Docker tests which aren't very comprehensive. I don't know any other teams that are running tests on 2025. There is one 2025 ARM queue for some reason. But no AMD64: dotnet/dnceng#3343.
I proposed in my PR that we ship the
nightly.NET images now to better facilitate testing while we wait on Helix queues. These images are functional, but we just want to understand the nuances of the globalization changes better. #5944tarekgh commentedon Nov 24, 2024
I already talked to Windows team and the behavior should be clear now. nano-server 2025 will work as nano-server-2022 which will use NLS. Both are not installing ICU till now. Only changes can be noticed when Windows updates the locale data, which usually happens almost with every release. Let me know if you have any more questions regarding globalization I can help with.
richlander commentedon Nov 24, 2024
Thanks. I think that is good enough. We have been so used to ICU at this point, that an NLS scenario seemed unique and different. Seems like we should move forward treating this as just another version upgrade.
Thanks for reaching out to the Windows team and helping us better understand the situation.
lbussell commentedon Nov 25, 2024
@tarekgh, so the presence or absence of
Windows.Globalization.dllshould not affect .NET's behavior?tarekgh commentedon Nov 25, 2024
That is correct, .NET don't depend on this library. This library is used by WinRT which we are not calling for globalization.
lbussell commentedon Nov 26, 2024
.NET images for Server 2025 are now published from our nightly branch (not supported for production yet). Can @tarekgh or @ericstj do any testing with these images to validate @tarekgh's claims here?
mcr.microsoft.com/dotnet/nightly/runtime:9.0-nanoserver-ltsc2025mcr.microsoft.com/dotnet/nightly/aspnet:9.0-nanoserver-ltsc2025mcr.microsoft.com/dotnet/nightly/sdk:9.0-nanoserver-ltsc2025tarekgh commentedon Nov 26, 2024
@lbussell I smoke tested the SDK image and I can confirm NLS is used successfully there and behave as expected.
richlander commentedon Nov 27, 2024
Thanks much!
lbussell commentedon Jan 7, 2025
Tests were added in #6120.