I’m trying to get NServiceBus working with the container I already use in my application.
I got excited when I saw that .AutofacBuilder will take a preexisting container or scope. However, I also want to register the bus with my container, so that other components in my application can get references to IBus.
This leaves me in catch-22. I need a reference to the created bus to register with my container. However, creating the bus requires a reference to the created container.
How do I resolve this issue?
NServiceBus will register the instance of IBus in the container itself – you don’t need to do it.