title: Why instances created with Activator.CreateInstance do not resolve references?
body: <p>I have an application with the following folder structure:</p>
  
  <pre><code>Application\Modules\XXX
  </code></pre>
  
  <p>Of course any assembly inside XXX finds other assemblies inside the XXX. </p>
  
  <p>The problem happens with some instances that are instantiated used reflection:</p>
  
  <pre><code>TProvider providerInstance = (TProvider)Activator.CreateInstance(providerType));
  </code></pre>
  
  <p>TProvider has a method that returns a class defined in another assembly (stored in XXX as well). When calling that method of the providerInstance that has to load a reference I'm getting a FileNotFoundException about not finding the dependent assembly even when the dependency is in the same XXX folder.</p>
  
  <p>Looking at the fusion log the assembly loader is only checking on the Application folder, not the XXX ... </p>
  
  <p>Any idea on why this happens and how to fix it?</p>
  
  <p>Thanks.</p>