microsoft orleans 如何将 IServiceCollection 替换为 Castle Windsor

microsoft orleans how to IServiceCollection replace to Castle Windsor

我正在使用 Microsoft Orleans 我想用 Castle Windsor

替换 IServiceCollection
.ConfigureServices((hostBuilderContext,services) => 
{
    var abpBootstrapper = AbpBootstrapper.Create<LimsServerModule>();
    abpBootstrapper.Initialize();
    WindsorRegistrationHelper.CreateServiceProvider(abpBootstrapper.IocManager.IocContainer, services);
});

此代码不生效

ISiloHostBuilderIClientBuilder 接口有一个方法,UseServiceProviderFactory,允许您指定您的服务提供商。

这里有一个如何在测试套件中使用此方法与 Autofac 的示例:https://github.com/dotnet/orleans/blob/62c1869b906f33def5ee0eb107365de5e8e24996/test/DependencyInjection.Tests/Autofac/DependencyInjectionGrainTestsUsingAutofac.cs#L31

相同的模式适用于温莎城堡。