Reputation: 13
I'm using Microsoft Orleans I want to replace an IServiceCollection with Castle Windsor
.ConfigureServices((hostBuilderContext,services) =>
{
var abpBootstrapper = AbpBootstrapper.Create<LimsServerModule>();
abpBootstrapper.Initialize();
WindsorRegistrationHelper.CreateServiceProvider(abpBootstrapper.IocManager.IocContainer, services);
});
This code does not take effect
Upvotes: 1
Views: 460
Reputation: 2401
The ISiloHostBuilder
and IClientBuilder
interfaces have a method, UseServiceProviderFactory
, which allows you to specify your service provider.
There is an example of how to use this method with Autofac in the test suite here: https://github.com/dotnet/orleans/blob/62c1869b906f33def5ee0eb107365de5e8e24996/test/DependencyInjection.Tests/Autofac/DependencyInjectionGrainTestsUsingAutofac.cs#L31
The same pattern applies to Castle Windsor.
Upvotes: 1