This question, does not answer my question.
I am referencing 2 dll's of the same application but 2 different versions . As I'm calling similar functions from both the dll's some of my code is getting repeated (currently I'm using base class and inheriting common functions but I'm not happy with that approach as it is not a DRY code).
I believe this can be solved if I can reference only one of the dll's during run time.
My application has the option to choose which version of that software to open, depending upon the version the user chooses.
One approach I could think was, The application should reference dll of that version, which the user chooses from the radio button, but I do not know how to do this, has someone done something like this before?
Sample code when using dll of earlier version
using ABC = ABC2015;
protected static string ABC_APP_PATH = System.IO.Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "ABC", "ABC 2015", "ABC.exe");
Sample code when using dll of current version
using ABC = ABC2016;
protected static string ABC_APP_PATH = System.IO.Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "ABC", "ABC 2016", "ABC.exe");
As we see in the example above, the code is written in 2 different files and same line is repeated, there are more such instances. if I can use conditinoal referencing, I believe, I can solve this issue.