Closed VladislavMorozov closed 4 years ago
Ok, so now I read this page about how Autofac integrates with ASP.NET Core – I did not know that that was how you were supposed to integrate Autofac these days.
Since calling .UseRebus()
on the IServiceProvider
seems to work, I suggest you don't 🙂
Also, Rebus' Autofac integration works by starting the bus when you call builder.Build();
(where builder
is the Autofac ContainerBuilder
, so there's no need to do additional things to get the bus started.
This also means that you can ditch the dependency on Rebus.ServiceProvider.
I have asp.net core 3.1 application, "Rebus.ServiceProvider" Version="5.0.2", "Rebus.ServiceProvider" Version="5.0.2", "Rebus.RabbitMq" Version="6.0.0", "Rebus.Autofac" Version="7.0.0". I registered rebus from Rebus.Autofac
builder.RegisterRebus(configure => ...);
in Startup.cspublic IServiceProvider ConfigureServices(IServiceCollection services)
and useapp.ApplicationServices.UseRebus(bus => ...);
from Rebus.ServiceProvider inpublic void Configure(IApplicationBuilder app)
. I caught this exception.https://user-images.githubusercontent.com/31768904/75884503-ff6f8e00-5e35-11ea-8281-70e006657f07.png