C# Castle Windsor:类型化工厂未使用注册的子解析器
我创建了简单工厂:C# Castle Windsor:类型化工厂未使用注册的子解析器,c#,castle-windsor,C#,Castle Windsor,我创建了简单工厂: public interface ICommandFactory { ICommand CreateCommand(string componentName); } 使用Windsor的类型化Factory功能实现: Container.AddFacility<TypedFactoryFacility>(); Container.Kernel.Register(Component.For<ICommandFactory>().AsFactor
public interface ICommandFactory
{
ICommand CreateCommand(string componentName);
}
使用Windsor的类型化Factory功能实现:
Container.AddFacility<TypedFactoryFacility>();
Container.Kernel.Register(Component.For<ICommandFactory>().AsFactory());
不幸的是,当我尝试为我的接口使用类型化工厂时,它没有使用自定义子解析器。
是否有人知道这个问题,或者这只是类型化工厂的工作方式:>
提前谢谢
Jakub在2.5版中使用。在2.5版中使用
Container.Kernel.Resolver.AddSubResolver(new CommandResolverByName(Container.Kernel, null));