title: Load assembly from Path
body: <p>I need to load an assembly from a certain location and not from the GAC. I can not remove the assembly from the GAC, because my program has to run on different machines, where I couldn't control if the assembly is in the GAC or not.</p>
  
  <p>I added a reference to the DLL-File to my project. Unfortuntely the assembly is loaded from the GAC.</p>
  
  <p>I've tried the following code in my <code>App.xaml.cs</code> in the <code>Startup</code>-Event</p>
  
  <pre><code>var directory = Thread.GetDomain().BaseDirectory;
  var dllPath = Path.Combine(directory, "MyAssembly.dll");
  var assembly = Assembly.LoadFrom(dllPath);
  </code></pre>
  
  <p>Unfortunately the assembly is still loaded from the GAC.</p>
  
  <p>What can I do to load it from the given location, even if the assembly is in GAC?</p>