-
Notifications
You must be signed in to change notification settings - Fork 965
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
The type initializer for 'Humanizer.Configuration.Configurator' threw an exception. #1126
Comments
Are you setting the global invariant mode anywhere as per https://aka.ms/GlobalizationInvariantMode? |
Yes I am in setting in project file as shown in the document.
Sent from Yahoo Mail for iPhone
On Saturday, September 25, 2021, 8:59 AM, Claire Novotny ***@***.***> wrote:
Are you setting the global invariant mode anywhere as per https://aka.ms/GlobalizationInvariantMode?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Hi, |
Hi, I got the above error after migrating my NET 5 application to NET 6. I was not explicitly setting the Globalization configuration setting in the
In my code, I create a custom type that implements ICollectionFormatter. I was adding this to the Configurator CollectionFormatters, as such. Humanizer.Configuration.Configurator.CollectionFormatters.Register("en", new CustomFormatter("and")); The fix was to disable InvariantGlobalization in the Project file, by setting InvariantGlobalization to false. Additionally, in my Dockerfile, shortly after I pull the Alpine image, I needed to install the ICU packages. ARG AspNetVersion
FROM mcr.microsoft.com/dotnet/aspnet:${AspNetVersion} AS base
WORKDIR /app
...
RUN apk add --no-cache icu-libs I found this article by Andrew Lock to be help! I hope this helps! |
I having the same issue. .NET 6 application using GlobalizationInvariantMode. Is there any way to make this library work in such applications? In my case, it's not in my hands to disable GlobalizationInvariantMode. Thanks! |
Now work |
Same problem here, and I don't want to disable |
Can anyone merge the PR that fixes this?? |
The same issue happened today .NET 8 Docker (Alpine). Is there a fix guys? |
@sangeethnandakumar there is a PR. #1213 but, before i merge it, i need some tests to confirm it fixes the actual issue |
Fixed the issue of the Humanize constructor crashing when in a docker container using this issue: Humanizr/Humanizer#1126
I am using the Humanizer.core in .NET Core 6 RC1 in Blazor WASM App.
This is what is throwing error in .razor page.
@searchResult.AlerSentTime?.Humanize(culture:CultureInfo.InvariantCulture);
The text was updated successfully, but these errors were encountered: