You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typically you would expect that the last registration for a given service would result in that implementation type being the type that will be resolved. This occurs given the following test:
However if you first locate the type and then modify the registrations the initial registration is cached and the new registration does not take effect.
container.Configure(c =>c.Export(typeof(IServiceA)).As(typeof(ServiceA1)));varinstance=container.Locate(typeof(IServiceA));Assert.IsType<ServiceA1>(instance);// Update the containercontainer.Configure(c =>c.Export(typeof(IServiceA)).As(typeof(ServiceA2)));instance=container.Locate(typeof(IServiceA));Assert.IsType<ServiceA2>(instance);// Fails because it resolved ServiceA1
The text was updated successfully, but these errors were encountered:
Description
Typically you would expect that the last registration for a given service would result in that implementation type being the type that will be resolved. This occurs given the following test:
However if you first locate the type and then modify the registrations the initial registration is cached and the new registration does not take effect.
The text was updated successfully, but these errors were encountered: