I try to create a modulable system in which each module can depend on other ones. Each module is a NuGet and their dependencies have to be resolved via NuGet. Each module contains a Type which will implements an shared Interface which allow for extracting a list of instruction.
All these instructions are to be executed in reverse order.
The detailed situation is this:
I have 4 projects which I will call
API
,S
,M1
,M2
. They are all NuGets and they depends one from another is that way (->
stands for 'depends on'):S -> API
,M1 -> S
,M2 -> M1
.On the other hand we have the projet
CORE
,CONSOLE
andTESTS
. They aren't NuGets but they references each others in this way (->
stands for 'references'):CORE -> S
,CONSOLE -> CORE
,TESTS -> CORE
.M1 et M2 are modules, once again they are special because they contains a Type which must be found and instantiated from within CORE.
The goal is this:
I must fetch and install locally NuGets from a given repository.
- This is done, it fetch the NuGets, unzip them into a given location.
I must inject the dlls from this extraction into the installer as if they were some sort of plugins.
- How do I inject the correct dlls from the imported NuGets knowing that:
- some of them are already present in the project
CORE
(notably the dlls that are present in the projectsAPI
andS
). - some of them contain copies of the dll for different .NET Frameworks.
- when I succeed to inject the dlls (by some artificial processes of filtering the
lib/whateverframework
directories and I try to find all the types which have a specific Attribute (which is located in the shared projectAPI
), this attribute seems to be different if I use the one which is in the dlls from NuGet and the one which I can directly use in VS.
- some of them are already present in the project
- How do I inject the correct dlls from the imported NuGets knowing that:
I use C# 6 and VS2015.
How could I load dlls into the running application with all its dependencies using NuGet core API to solve dependencies? What is the best/proper way to do this?