Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

AddHttpContextOrThreadScoped does not register multiple services correctly

Fixed in

EPiServer.CMS.Core 11.1.0

(Or a related package)

Created

Oct 02, 2017

Updated

Nov 21, 2017

Area

CMS Core

State

Closed, Fixed and tested


Description

When using AddHttpContextOrThreadScoped<TService, TImpl>() to register multiple implementations, the last implementation is registered for all. So, calling ServiceLocator.Current.GetAllInstances<TService>() does not return all types – it returns a list of the last registered type.