I have a class that should have access to my IOC (Windsor) container, however I donβt want to support the static IWindsorContainer property - I would prefer the container to inject itself into any classes that require IWindsorContainer as a constructor dependency.
I shot this with Unity, but when I try to do the same with the Windsor container, it tells me that the IWindsorContainer is not registered in the container.
I donβt think I can just register IWindsorContainer => WindsorContainer, because it will force the container to create a new (or another) instance itself for transfer to my class, and this instance will not have all my other types registered with it. I also donβt see a way to build a container, register all types in it, and then register this instance myself in relation to IWindsorContainer - all registration methods accept only types for maintenance and implementation - they are never a specific concrete instance.
Terence lewis
source share