Hi, I have a Windows service (.Net FW 4.7.2) in which I’m using Nservicebus 7.2.0 and I have setup MS extensions DI.
I’d like to use the existing DI container, where I have a Singleton service configured. I want this service to be injected in one of my Handlers (so my Handler will call one of its methods and pass the new incoming message).
I was able to configure DI on my endpoint using a new container, so my Handler was injected with a new instance of my service:
var containerSettings = endpointConfiguration.UseContainer(new DefaultServiceProviderFactory());
Alternatively - is there another way to pass the incoming message object from my Handler to my service (which is Injected as Singleton, NOT static).