When I use this registration:
container.Register(
Component
.For<IFooFactory>()
.ImplementedBy<FooFactory>(),
Component
.For<IFoo>()
.UsingFactoryMethod(kernel => kernel.Resolve<IFooFactory>().CreateFoo())
);
I get this exception:
Castle.MicroKernel.ComponentRegistrationException: Type MyNamespace.IFoo is abstract. As such, it is not possible to instansiate it as implementation of MyNamespace.IFoo service
I m not really sure what the problem is. But the stack trace shows that in DefaultComponentActivator.CreateInstance() , the following condition succeeds and then the error is thrown:
if (createProxy == false && Model.Implementation.IsAbstract)
Do I need a proxy of some sort here? Is the registration wrong?