simpleinjector / SimpleInjector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
https://simpleinjector.org
MIT License
1.21k stars 155 forks source link

Using Microsoft DI and Simple injector the other way around (reversed crosswire) to integrate with NServiceBus? #977

Closed maverick543 closed 8 months ago

maverick543 commented 1 year ago

We have been using simpleinjector for a long time in our solutions. A lot of code has been build on this. Currently we are working on replacing our servicebus solution with a new one based on NServiceBus. Unfortunately this means we need to use Microsoft DI for these parts instead of SimpleInjector.

Crosswire solves one problem, namely the duplicate registration. Everything from M DI is usable from SimpleInjector.

But we are searching for a solution the other way around. As NServiceBus lives on the M DI, it's handlers can only use the entities registered in that container. Crosswire from M DI into SimpleInjector will help us a lot in not having to rewrite all our existing handlers.

I hope someone might have a solution on this.

dotnetjunkie commented 1 year ago

Hopefully this thread provides any guidance that's useful to you. If not, let me know.