-
Notifications
You must be signed in to change notification settings - Fork 966
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. #373
Comments
Thanks for reporting this. This is really strange. The error says zh-CHS can't be used as a culture identifier, and Is that the locale you're using? Would you be able to send a failing test for this issue? |
zh-CHS and zh-CHT are legacy and it throws exception when you run on Windows phone. You must be running test on the PC. It passes on the PC but fails on the phone. https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent |
I fixed that in #374 and it's now been released to NuGet. Please check if it's fixed now. |
It works fine now. Thanks. |
Thanks for reporting and for the link to right culture codes. |
System.TypeInitializationException: The type initializer for 'Humanizer.Configuration.Configurator' threw an exception. ---> System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
zh-CHS is an invalid culture identifier.
at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
at System.Globalization.CultureInfo..ctor(String name)
at Humanizer.Configuration.FormatterRegistry.RegisterDefaultFormatter(String localeCode)
at Humanizer.Configuration.FormatterRegistry..ctor()
at Humanizer.Configuration.Configurator..cctor()
--- End of inner exception stack trace ---
at Humanizer.TimeSpanHumanizeExtensions.d__4.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext() at System.Linq.Enumerable.<takeiterator>d__3a
1.MoveNext()at System.String.Join(String separator, IEnumerable`1 values)
at Humanizer.TimeSpanHumanizeExtensions.Humanize(TimeSpan timeSpan, Int32 precision, Boolean countEmptyUnits, CultureInfo culture)
at Humanizer.TimeSpanHumanizeExtensions.Humanize(TimeSpan timeSpan, Int32 precision, CultureInfo culture)
at Flashlight.MainPage.SetBatteryText(Int32 remainingChargePercent, TimeSpan remainingDischargeTime)
at Flashlight.MainPage.LoadUIComponents()
at Flashlight.MainPage.b__2d()
--- Inner exception of type System.Globalization.CultureNotFoundException start ---
--- Message: Culture is not supported. Parameter name: name zh-CHS is an invalid culture identifier. ---
System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
zh-CHS is an invalid culture identifier.
at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
at System.Globalization.CultureInfo..ctor(String name)
at Humanizer.Configuration.FormatterRegistry.RegisterDefaultFormatter(String localeCode)
at Humanizer.Configuration.FormatterRegistry..ctor()
at Humanizer.Configuration.Configurator..cctor()
--- End of inner exception stack trace ---
The text was updated successfully, but these errors were encountered: