ProviderBasedLocalizationService.Providers is not thread safe

Found in

EPiServer.CMS.Core 7.5.394.2

Fixed in

EPiServer.CMS.Core 11.1.0

Created

Jun 15, 2017

Updated

Nov 21, 2017

Area

CMS Core

State

Closed, Fixed and tested


Description

If a thread is adding a localization provider at the same time as a localized string is requested, this may lead to an InvalidOperationException due to the provider enumeration not being thread-safe.

Even though it is discouraged to call the LocalizationService during startup it is still possible, such as in the case of the constructor of the DisplayResolution class.

Breaking changes

  • The Provider property is no longer supported, as it's not possible to expose a fully thread-safe IList implementation. Providers can instead be added and manipulated through methods AddProvider or InsertProvider. The current set of providers can be inspected by calling the ProviderList property.