I added CollectionResolver as a subtask of my Windsor kernel, and it will correctly inject dependency collections for allowed objects. That is, if I have
class X { public X(IComponent[] components) { ... } } container.Register(); container.Register(Component.For<X>());
the components argument to the constructor is correctly built when I allow it
container.Resolve<X>()
but instead, I just wanted to get a list of the components themselves,
container.Resolve<IComponent[]>()
I get a ComponentNotFound exception complaining that I have not registered any components for IComponent[] . I find this asymmetry to be contradictory, because I'm not sure why the kernel should act differently when it resolves the dependencies found in the constructors / properties, compared to when they resolve the dependencies that its user would like to resolve .
Sebastian good
source share