I'm writing a extension-based program where you can add a module to it by inserting a compatible DLL into a folder titled "Modules". I've figured out how to access the relative-located extensions without explicit references (and that took quite a while of playing with reflection).
The program will come in two versions. One with a GUI, and one as a console application. They both will serve the same purpose and do the same things but they target different audiences (some prefer use a Console Application while others like a Windows Form), so they both need access to the same methods. My solution to that was to create a core library DLL which contains all the necessary methods which both versions will 100% be using.
Modules also use the Core DLL and therefore the Core DLL needs to be in the same folder as those modules.
My problem is I want to access this Core DLL from the Modules folder, but I don't want to have to have a program.exe.config
lying around, because that config somewhat nullifies the purpose of having the Core library in the Modules folder.
using Core;
namespace Placeholder {
class Program {
// Code goes here
}
}
I need to keep that using directive, but I want it to look for the DLL in the Modules folder. The directory tree for the program would always be as follows:
Root
|- Program.exe
|- ProgramGUI.exe
|- Modules/
|- Core.DLL
|- Any other extensions
From what research I've done, there isn't any actual way to do what I'm asking, but none of the questions I've found are specifically asking what I want to know either. I felt I should ask directly, just to be sure.
To clarify:
Is there any way to do what I am asking?
In the event that there isn't, is it possible to package the Program.exe.config with both versions of the program and have it extracted from the program before using directives are resolved, or must it be shipped outside the program?
If you need specific code samples please ask and I will provide.
Thanks.