Dependency injection when loading an assembly dynamically

I have a winforms application that has many IOrderDataLoader implementations. Other teams are starting to create their own new IOrderDataLoader implementations. So we switched our application to look in the Dlls directories and load all classes that implement IOrderDataLoader using reflection. This way, other teams can deploy their DLLs themselves, and the main application loads them on demand.

The problem is one of the implementations we have as an internal project that we are trying to move into our own deployment has a number of dependencies. How can I break this and load it with all dependencies? All other data loader has empty constructors, so I just just loop ..

+1


source to share


1 answer


Try looking for Managed Extensibility Framework . This is the foundation for doing what you've already done and supports dependency injection in the style you requested.



+2


source







All Articles