In case you don’t need to inject
IEndpointInstance in your services, passing an existing autofac container doesn’t require a workaround as described in the linked google group question. See our Autofac documentation for more details how to pass an existing container to NServiceBus.
Registering back the created
IEndpointInstance is indeed a bit tricky but also highly depends on the used container. Some allow runtime registrations, some don’t. We support most major DI containers, maybe there’s another container which you would prefer: https://docs.particular.net/nservicebus/dependency-injection/#supported
Currently we do not support integration with the built-in ASP.NET provider. As far as I understand, the built-in container only support
PerRequest scopes while NServiceBus requires the ability to define custom scopes. But it should be possible to share a container between ASP.NET and NSB in case this container supports both.