I have Simple Injector registration of my:
container.RegisterConditional(typeof(ILogManager),
c => typeof(LogManager<>).MakeGenericType(c.Consumer.ImplementationType),
Lifestyle.Singleton,
c => true);
I need to register same LogManager in different project using Castle Windsor.
I have tried
container.Register(Component.For(typeof(ILogger))
.ImplementedBy(typeof(Log4NetLogger<>).MakeGenericType())
.LifeStyle.Singleton.Start());
Cannot make it working.
Unfortunately this is more complicated with Castle. But you can achieve the same result with SubDependencyResolver:
than add it into the kernel:
Another way is to use GenericImplementationMatchingStrategy. This one will work also in situation if LogManager has some dependencies:
and registration: