I have a C# console application and like to chose by user input a specific dll library that is loaded and executed during the runtime of the console app. Is that possible?
So, for example, I may have 2 dll libraries with the same static class and Action name as follows:
public static class CoreStrategy
{
public static Action<List<Quote>> strategyQuoteBuffer = new Action<List<Quote>>(quoteList =>
{
Console.WriteLine("I am dll 1");
});
}
public static class CoreStrategy
{
public static Action<List<Quote>> strategyQuoteBuffer = new Action<List<Quote>>(quoteList =>
{
Console.WriteLine("I am dll 2");
});
}
How can I load one of them during the runtime of my console app and invoke them, then switch one for the other one? Or are there better ways to handle this? Maybe even different ways from Dlls? Requirement is that the code of each is strictly contained within its own dll, only and the dlls cannot be referenced beforehand. If that is not doable then would you be able to suggest a way without the usage of dlls? Thanks