title: Adding references dynamically in .NET
body: <p>I have two dll's (sqlite) , one dll is a 64 bit and other 32 bit dll. Is it possible to add reference dynamically based on processor architecture? P/Invoke is my last option. Any help would be appreciated!!</p>
  
  <p>Sample Code:</p>
  
  <pre><code>string pathToDll = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\x64\\System.Data.SQLite.dll";
  Assembly assembly = Assembly.LoadFrom(pathToDll);
  AppDomain.CurrentDomain.Load(assembly.GetName());
  </code></pre>