-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot register multiple service impls in child container with default service key. #574
Comments
Hi @Amleto Yes, in regard to So you have uncovered (for me too) that using the unique key won't allow the multiple default implementations in the child containers. I think you may use the registration metadata to achieve this behavior, because it is not supposed to be unique. |
Yes. Unfortunately I filed this/these report yesterday when GitHub was having troubles. I got a lot of error responses before one was successful. Seems GitHub reported an error to me even though it posted ok.
|
The first test works, and I expect to be able to do similar with a child container. However, the fact that the child container has a default key seems to break this expectation.
childContainer.Populate(services);
hard-codes append-if-not-keyed, so I tried callingchildContainer.RegisterDescriptor
in the loop, but discovered thatAppendNewImplementation
andAppendNotKeyed
are basically not allowed inRegsitry.WithKeyedService(...)
.Functionally, I'm looking to move away from a setup with unity container that has child containers. ie child containers can resolve from parent, but cannot interfere with parent registrations. Parent cannot see child services/registrations.
Please let me know if this is achievable.
I will update IssuesTests shortly.
The text was updated successfully, but these errors were encountered: