Conditional registration of sub resolver

27 views
Skip to first unread message

Scott_M

unread,
Mar 11, 2016, 10:53:54 AM3/11/16
to Castle Project Users
He do you check to see if a sub-resolver has previously been registered by another installer? Want to avoid duplicate registration of ArrayResolver.


Castle Windsor 3.3.0


Jonathon Rossi

unread,
Mar 12, 2016, 7:54:49 AM3/12/16
to Castle Project Users
There isn't anything built-in as IDependencyResolver doesn't expose the list. There shouldn't be any behaviour differences with more than one instance of ArrayResolver registered because the first one will return true to CanResolve. Were you getting an error, some problem or just didn't want multiple copies registered?

You could provide Windsor your own IDependencyResolver (can subclass DefaultDependencyResolver) and do something like this to access the subresolvers: https://gist.github.com/jonorossi/0ac344d74be2f3bba1b9. I suspect access to the collection hasn't been added in the past is that the ideal is that installers don't have to check to the container before registering things, you'd just have a single installer that registered the ArrayResolver.

On Sat, Mar 12, 2016 at 1:53 AM Scott_M <scott.kenda...@gmail.com> wrote:
He do you check to see if a sub-resolver has previously been registered by another installer? Want to avoid duplicate registration of ArrayResolver.


Castle Windsor 3.3.0


--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-u...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at https://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages