What is the equivalent of CultureInfo.GetCultureInfo()
in ASP.NET 5 (vNext)? When compiling against ASP.NET Core 5.0 and trying to call that method, I get the following error:
ASP.NET Core 5.0 error CS0117: 'CultureInfo' does not contain a definition for 'GetCultureInfo'
The CultureInfo class specifies a unique name for each culture, based on RFC 4646. The name is a combination of an ISO 639 two-letter lowercase culture code associated with a language and an ISO 3166 two-letter uppercase subculture code associated with a country or region. In addition, for apps that target .
The invariant culture is culture-insensitive; it is associated with the English language but not with any country/region. You specify the invariant culture by name by using an empty string ("") in the call to a CultureInfo instantiation method. CultureInfo.
The CultureInfo. CurrentCulture property is a per-thread setting; that is, each thread can have its own culture. You get the culture of the current thread by retrieving the value of the CultureInfo. CurrentCulture property, as the following example illustrates. C# Copy.
Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers.
For ASP.NET Core 1.0 RC2 and RTM use constructor parameter:
var ruCulture = new CultureInfo("ru-RU");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With