rebus-org / Rebus.ServiceProvider

:bus: Microsoft Extensions Dependency Injection container adapter for Rebus
https://mookid.dk/category/rebus
Other
65 stars 32 forks source link

Question about Rebus.ServiceProvider + Rebus.Autofac. #29

Closed VladislavMorozov closed 4 years ago

VladislavMorozov commented 4 years ago

Hello! How to use app.ApplicationServices.UseRebus();, if I registred rebus from autofac builder.RegisterRebus(); ?

mookid8000 commented 4 years ago

Check this out: 👉 https://github.com/rebus-org/Rebus.ServiceProvider#a-vanilla-console-app

VladislavMorozov commented 4 years ago

But this example to console app. I think is a too uncomfortable way for a web app.

VladislavMorozov commented 4 years ago

image

I mean this is a problem to migrate from previous versions.

mookid8000 commented 4 years ago

oh, sorry – if you scroll up a bit, then the example is for a web app: 👉 https://github.com/rebus-org/Rebus.ServiceProvider#in-aspnet-core-20-startupcs

VladislavMorozov commented 4 years ago

But I catch the exception. Look at the previous picture.

VladislavMorozov commented 4 years ago

I registered rebus from Rebus.Autofac builder.RegisterRebus(); and use app.ApplicationServices.UseRebus(); from Rebus.ServiceProvider.

https://user-images.githubusercontent.com/31768904/75884503-ff6f8e00-5e35-11ea-8281-70e006657f07.png

mookid8000 commented 4 years ago

ah ok.... I got a little bit confused there.

You need to explain to me how Autofac and ServiceProvider work together in your scenario

VladislavMorozov commented 4 years ago

Ok, I will describe in new issue.