I seem to have a problem - rather unexpected; so I guess I might be doing something silly/wrong.
I register two container scoped services as such:
builder.Register<IServiceInfo>(c => CreateServiceInfo(c)).As<IServiceInfo>();
builder.Register<IServiceInfo>(c => CreateServiceInfoSomeOther(c)).As<IServiceInfo>().Named("someOther");
Now when I try to resolve
container.Resolve<IServiceInfo>()
and container.Resolve<IServiceInfo>("someOther")
I get the same instance. I would expect the first call to return the first instance and the second call to return the second instance. Why is this happening this way?
I am hoping there are some active Autofac experts around here and I'd appreciate any help to quickly fix this.
Thanks, all!