title: C# : Conditional referencing of dll's based on radio button selection
body: <p><a href="https://stackoverflow.com/questions/7798052/conditional-reference">This question</a>, does not answer my question. </p>
  
  <p>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). </p>
  
  <p>I believe this can be solved if I can reference only one of the dll's during run time.</p>
  
  <p>My application has the option to choose which version of that software to open, depending upon the version the user chooses. </p>
  
  <p>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?   </p>
  
  <p>Sample code when using dll of earlier version</p>
  
  <pre><code>using ABC = ABC2015;
  
   protected static string ABC_APP_PATH = System.IO.Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "ABC", "ABC 2015", "ABC.exe");
  </code></pre>
  
  <p>Sample code when using dll of current version</p>
  
  <pre><code>using ABC = ABC2016;
  
   protected static string ABC_APP_PATH = System.IO.Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "ABC", "ABC 2016", "ABC.exe");
  </code></pre>
  
  <p>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.</p>