コンポーネントを削除する方法が見つかりませんでした (これは再度追加する必要があります)。
DelegateFactory を無効にする最善の方法は、TypedFactoryFacility クラスを使用して Typed Factory をセットアップするのをやめ、デリゲート ファクトリ メソッドを除いて、その内部の Init 関数のコードを使用することでした。
そのとおり:
// Stop using AddFacility
//container.AddFacility<TypedFactoryFacility>();
// Initialise the TypedFactoryFacility manually, leaving out the DelegateFactory components.
container.Kernel.Register(new IRegistration[] {
Component.For<TypedFactoryInterceptor>().NamedAutomatically(TypedFactoryFacility.InterceptorKey),
// Disable DelegateFactory
// Component.For<ILazyComponentLoader>().ImplementedBy<DelegateFactory>().NamedAutomatically(TypedFactoryFacility.DelegateFactoryKey),
Component.For<ITypedFactoryComponentSelector>().ImplementedBy<DefaultTypedFactoryComponentSelector>().NamedAutomatically("Castle.TypedFactory.DefaultInterfaceFactoryComponentSelector"),
// Disable DelegateFactory
// Component.For<ITypedFactoryComponentSelector>().ImplementedBy<DefaultDelegateComponentSelector>().NamedAutomatically(TypedFactoryFacility.DefaultDelegateSelectorKey)
});
container.Kernel.ComponentModelBuilder.AddContributor(new TypedFactoryCachingInspector());
"Castle.TypedFactory.DefaultInterfaceFactoryComponentSelector"
DefaultInterfaceSelectorKey
内部フィールドであるマジック ストリングを使用する必要がありました。
デリゲート ファクトリがすべてを台無しにすることなく、インターフェイス ファクトリを使用できるようになりました。