List all IRegistrations in WindsorContainer/Kernel
-
22-10-2019 - |
Question
How do I get a list of all IRegistrations/ComponentRegistrations in my WindsorContainer or its kernel? I can see a way of doing this by wiring to the ComponentRegistered event and tracking there, but is there an eaiser way?
Thanks.
Solution
You can get the handlers from the container, but not the IRegistrations:
IHandler[] handlers = container.Kernel.GetAssignableHandlers(typeof(object));
Handlers are basically the registered components. IHandler.ComponentModel contains most of the information of a registered component.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow