Support Globalization
First of all, thank you for the great job with this library!
I’m encountering an issue with a library that relies on creating a CultureInfo object, which fails due to the globalization-invariant mode being enabled.
Exception Details:
System.Globalization.CultureNotFoundException:
Message='Only the invariant culture is supported in globalization-invariant mode.
What I Tried:
I attempted to set System.Globalization.Invariant to false in my configuration, but this did not resolve the issue. Upon further investigation, I found that the Bootsharp.props file contains the following:
<InvariantGlobalization>true</InvariantGlobalization>
Question:
Is there any way to override InvariantGlobalization=true in the current setup? If not, are there alternative approaches to enable support for CultureInfo in the Wasm build?
Thank you for your help!
Notes
An alternative to supporting the default globalization (and including the ICU payload) is to use the currently experimental hybrid globalization:
- https://github.com/dotnet/runtime/blob/main/src/mono/wasm/features.md#globalization-icu
- https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-hybrid-mode.md
Afaik, props defined in the .csproj are supposed to override the defaults. Maybe something else is affecting this, like <BootsharpAggressiveTrimming>? https://github.com/elringus/bootsharp/blob/main/src/cs/Bootsharp/Build/Bootsharp.targets#L16
Though, it's also possible we are not bundling the icudt.dat and similar resources for the cultures to work. I never needed those myself, so didn't test that.
Though, it's also possible we are not bundling the
icudt.datand similar resources for the cultures to work. I never needed those myself, so didn't test that.
I think this might be the reason.