【问题标题】:microsoft orleans how to IServiceCollection replace to Castle Windsor微软奥尔良如何将 IServiceCollection 替换为 Castle Windsor
【发布时间】:2018-07-31 15:41:39
【问题描述】:

我正在使用 Microsoft Orleans 我想用 Castle Windsor 替换 IServiceCollection

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

此代码不生效

【问题讨论】:

标签: orleans


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 2021-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多