I'm trying to register some open generics
If I do it like this it works
Component
.For(typeof(IDtoFactory<>))
.ImplementedBy(typeof(DtoFactoryBase<>))
.LifestyleSingleton()
However if I try to register like this it fails
Classes
.FromThisAssembly()
.BasedOn(typeof(IDtoFactory<>))
.WithServiceAllInterfaces()
.LifestyleSingleton()
I don't really mind having to have an abstract base class to make this work but it's a bit of a pain nonetheless as I'd be happy with all the factories just implementing the interface.
I get an error like the following
Service 'MyProj.Factories.IDtoFactory`1
[[MyProject.Models.MemberDto,
MyProject,
Version=2.0.0.1,
Culture=neutral,
PublicKeyToken=null]]' which was not registered.
I'm using the latest version of Castle Windsor ~3.3
Am I doing anything wrong with my Classes
registration for an open generic?
So this is incredibly frustrating
I went to build an example of it not working here and it worked first time with no problems. I'll have to look into my implementation at work because clearly there's some differences.