The original case is here https://dotnetfiddle.net/HaV38I
But it works as intended (does not resolve the keyed service without key) when WithFactorySelector is commented out.
var rules = Rules.Default
.WithConcreteTypeDynamicRegistrations(reuse: Reuse.Transient)
.With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))
.WithFuncAndLazyWithoutRegistration()
.WithTrackingDisposableTransients();
// .WithFactorySelector(Rules.SelectLastRegisteredFactory()); // works when commented
var c = new Container(rules);
c.Register(typeof(IServiceA), typeof(ServiceA), Reuse.Transient, ifAlreadyRegistered: IfAlreadyRegistered.Replace, serviceKey: "Test");
var serviceA = c.Resolve<IServiceA>(IfUnresolved.ReturnDefault);
Assert.IsNull(serviceA);
The original case is here https://dotnetfiddle.net/HaV38I But it works as intended (does not resolve the keyed service without key) when
WithFactorySelector
is commented out.