title: PrivateBinPath outside ApplicationBase
body: <p>My directory structure looks like this:</p>
  
  <pre><code>-- Host Program Base
    |- HostProgram.exe
    |- SharedLIB.dll
    |-- LoadedLibs
       |- HostedLib.dll
  </code></pre>
  
  <p><code>HostProgram.exe</code> is attempting to load <code>HostedLib.dll</code>, which depends on <code>SharedLib.dll</code>. </p>
  
  <p>Thus, <code>SharedLib.dll</code>'s <code>ApplicationBase</code> for the <code>AppDomain</code> I am creating to load it is <code>/Host Program Base/HostedLibs/</code>, but it needs to be able to find <code>SharedLib.dll</code>.</p>
  
  <p>I have tried to add <code>..</code> to the <code>PrivateBinPath</code> for the <code>AppDomain</code> but according to <a href="http://msdn.microsoft.com/en-us/library/system.appdomainsetup.privatebinpath.aspx" rel="nofollow">MSDN</a>, </p>
  
  <blockquote>
    <p>Private assemblies are deployed in the same directory structure as the application. If the directories specified for PrivateBinPath are not under ApplicationBase, they are ignored.</p>
  </blockquote>
  
  <p>As the <code>PrivateBinPath</code> is not inside the <code>ApplicationBase</code>, but rather is one directory up, it is not inside <code>ApplicationBase</code> and is being ignored. Therefore I get a <code>AssemblyResolveException</code> when attempting to load the DLL into the new <code>AppDomain</code>.</p>
  
  <p>I have also attempted to set the <code>ApplicationBase</code> to the <code>Host Program Base</code> folder and add <code>HostedLibs</code> as a <code>PrivateBinPath</code>, but this causes the domain to be unable to resolve <code>HostedLib.dll</code> at all.</p>
  
  <p>So -> <strong>how do I resolve libraries outside <code>ApplicationBase</code> using an <code>AppDomainSetup</code></strong>?</p>