I use Nservicebus default container (autofac) in my endpoint. The registration of the service is through NSB API endpointConfiguration.RegisterComponents(c => c.ConfigureComponent<ServiceAWorker>(DependencyLifecycle.InstancePerCall));
Moving to .net core, It seems like the property injection doesn’t work in the endpoint by using the NSB default container.
Is there a way to make it work without changing the code above to register a component?
Are you by any chance using our extensions for MS DependencyInjection?
I ask since the abstractions from Microsoft doesn’t support property injection and you would have to either use funcs to set the properties your self or make sure to use a container that supports property injection like Autofac.
Thanks for the quick response. NServiceBus (7.3.0). Yeah. I was aware of property injection limitations of MS DI. We were trying to use Autofac but using the NSB api to register.
I created a sample PropertyInjectionSample
How can I make the property injection work without changing the dependency registration? trying to port existing application and want to minimize scope.
Not that I’m aware of but there might be some Autofac trickery that would enable you to turn this on by default for all registrations so it might be worth asking them for advice?