CultureInfo.ClearCachedData Method

Definition

Refreshes cached culture-related information.

public void ClearCachedData ();

Remarks

Information, such as the default culture and format patterns, is cached the first time it is requested. That information can change during the life of the AppDomain, for example, when the user modifies the regional and language options portion of Control Panel. However, the CultureInfo class does not automatically detect changes in the system settings.

The ClearCachedData method clears the cache of CultureInfo objects created by GetCultureInfo and refreshes the information in the CurrentCulture, CurrentUICulture, and CurrentRegion properties, based on the current system settings.

The ClearCachedData method does not refresh the information in the Thread.CurrentCulture property for existing threads. However, future threads will have any new CultureInfo property values.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1