title: Dynamically load a DLL from a specific folder?
body: <p>At the moment, I have this code :</p>
  
  <pre><code>var shellViewLibrary = Assembly.LoadFrom(Path.Combine(_DllsPath, _DllShellView));
  IEnumerable&lt;Type&gt; types = shellViewLibrary.GetTypes();
  
  foreach (Type type in types)
  {
      var typeIShellViewInterface = type.GetInterface(_NamespaceIShellView, false);
      if (typeIShellViewInterface != null)
      {
          //here
      }
  }
  </code></pre>
  
  <p>The thing is that where I got <code>//here</code> I want to use <code>Activator.CreateInstance</code> to create an object whose type is <code>type</code> <strong>in a specific folder</strong> (that is outside the build folder)
  I tried about 20 different things, most of them with this : <a href="http://msdn.microsoft.com/en-us/library/d133hta4.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/d133hta4.aspx</a>
  but none works...
  The typical thing I tried is :</p>
  
  <pre><code>object MyObj = Activator.CreateInstance(shellViewLibrary.FullName, type.FullName);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>object MyObj = Activator.CreateInstance(Path.Combine(_DllsPath, _DllShellView), type.FullName);
  </code></pre>
  
  <p>I always got different exception, the most common being :</p>
  
  <pre><code>XamlParseException
  </code></pre>
  
  <p>I feel like that I'm not using Activator.CreateInstance in the right way with 2 parameters. What should I do ?</p>