title: Loading DLL into separate AppDomain
body: <p>I am writing a plugin architecture.  My plugin dlls are located in a sub directory from where the plugin manager is running.
  I am loading the plugins into a separate AppDomain as the following:</p>
  
  <pre><code>string subDir;//initialized to the path of the module's directory.
  AppDomainSetup setup = new AppDomainSetup();
  setup.PrivateBinPath = subDir;
  setup.ApplicationBase = subDir;
  
  AppDomain newDomain= AppDomain.CreateDomain(subDir, null, setup);
  
  byte[] file = File.ReadAllBytes(dllPath);//dll path is a dll inside subDir
  newDomain.Load(file);
  </code></pre>
  
  <p>However.  newDomain.Load returns an assembly which the currently domain attempts to load.  Because the plugin dlls are in a sub directory, the current domain cannot and should not see these dlls and the current domain throws a FileLoadException
  "ex = {"Could not load file or assembly ... or one of its dependencies."</p>
  
  <p>The question is, can we load an assembly into a separate AppDomain without it returning the loaded assembly?</p>
  
  <p>I know I can add a handler for the AssemblyResolve event in the current domain and return a null, but I would prefer to not to go this route.</p>
  
  <p>Thanks in advance.</p>