title: Could not load file or assembly 'XXXX.dll' or one of its dependencies. The specified module could not be found
body: <p>I have an application that directly references a  dll file: <code>POSLink.dll</code>.  </p>
  
  <p>In order to get this to run on my local machine, I have to manually copy the following dlls to the output directory:  <code>libea32.dll</code> and <code>ssleay32.dll</code>.</p>
  
  <p>When I run the application on my local machine, it succeeds.</p>
  
  <p>When I run the application on the target machine, I get the following error:</p>
  
  <blockquote>
    <p>Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'POSLink.dll' or one of its dependencies. The specified module could not be found.<br>
       at FileNotFoundExceptionExample.Program.Main(String[] args)</p>
  </blockquote>
  
  <p>This is my SSCCE</p>
  
  <pre><code>using POSLink;
  using System;
  
  namespace FileNotFoundExceptionExample
  {
      class Program
      {
          static void Main(string[] args)
          {
              // this is stuff found in the POSLink namespace
              var commSetting = new CommSetting();
              commSetting.saveFile();
  
              Console.WriteLine("Success");
          }
      }
  }
  </code></pre>
  
  <p>I tried using <a href="http://www.dependencywalker.com/" rel="nofollow">Dependency Walker</a> on POSLink.dll, but that wasn't very useful to me because there are 381 errors that show up, and they show up when I run it on the successful machine too.  </p>
  
  <p>How do I even begin troubleshooting this error?</p>
  
  <hr>
  
  <p>When I run the Fuision log viewer and then run the application on the target machine, I get the following log:</p>
  
  <blockquote>
    <p><strong>* Assembly Binder Log Entry  (7/19/2016 @ 2:18:48 PM) *</strong>  </p>
    
    <p>The operation was successful. Bind result: hr = 0x0. The operation<br>
    completed successfully.  </p>
    
    <p>Assembly manager loaded from:<br>
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under<br>
    executable<br>
    C:\Users\Omitted\Desktop\notfoundexceptionexample\debug  \FileNotFoundExceptionExample.exe<br>
    --- A detailed error log follows.   </p>
    
    <p>=== Pre-bind state information === LOG: DisplayName = POSLink, Version=1.0.5773.36725, Culture=neutral,<br>
    PublicKeyToken=f3876d2e4b7eb819  (Fully-specified) LOG: Appbase =<br>
    file:///C:/Users/Omitted/Desktop/notfoundexceptionexample/debug/ LOG:<br>
    Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base =<br>
    NULL LOG: AppName = FileNotFoundExceptionExample.exe Calling assembly<br>
    : FileNotFoundExceptionExample, Version=1.0.0.0, Culture=neutral,<br>
    PublicKeyToken=null.<br>
    === LOG: This bind starts in default load context. LOG: Using application configuration file:<br>
    C:\Users\Omitted\Desktop\notfoundexceptionexample\debug\FileNotFoundExceptionExample.exe.Config<br>
    LOG: Using host configuration file:  LOG: Using machine configuration<br>
    file from<br>
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.<br>
    LOG: Post-policy reference: POSLink, Version=1.0.5773.36725,<br>
    Culture=neutral, PublicKeyToken=f3876d2e4b7eb819 LOG: GAC Lookup was<br>
    unsuccessful. LOG: Attempting download of new URL<br>
    file:///C:/Users/Omitted/Desktop/notfoundexceptionexample/debug/POSLink.DLL.<br>
    LOG: Assembly download was successful. Attempting setup of file:<br>
    C:\Users\Omitted\Desktop\notfoundexceptionexample\debug\POSLink.dll<br>
    LOG: Entering run-from-source setup phase. LOG: Assembly Name is:<br>
    POSLink, Version=1.0.5773.36725, Culture=neutral,<br>
    PublicKeyToken=f3876d2e4b7eb819 LOG: Binding succeeds. Returns<br>
    assembly from<br>
    C:\Users\Omitted\Desktop\notfoundexceptionexample\debug\POSLink.dll.<br>
    LOG: Assembly is loaded in default load context.  </p>
  </blockquote>