Closed SamPersson closed 2 years ago
Another oversight!
Otherwise maybe adding overloads for AddRebusService() that forwards the HostBuilderContext to the configureServices callback like this could be useful for console applications? https://github.com/rebus-org/Rebus.ServiceProvider/compare/master...SamPersson:Rebus.ServiceProvider:host-builder-context
This sounds like the way to go! Are you kneading another PR? 😉
Sure :)
Fixed by @SamPersson 's PR in Rebus.ServiceProvider 8.2.0
When trying to use
AddRebusService()
to start multiple Rebus instances in a console application using the genericIHostBuilder
(so not using WebApplicationBuilder) I could not find any easy way to access the app configuration when registering the instance specific services.The common methods on
IHostBuilder
likeConfigureServices
give you aHostBuilderContext
that contains the Configuration and some other useful things, in addition to theIServiceCollection
. Is there another way to access the app configuration that I did not think of? Otherwise maybe adding overloads forAddRebusService()
that forwards theHostBuilderContext
to theconfigureServices
callback like this could be useful for console applications? https://github.com/rebus-org/Rebus.ServiceProvider/compare/master...SamPersson:Rebus.ServiceProvider:host-builder-context That would enable: