title: When loading managed c++ dll using Assembly.LoadFrom() receive file not found exception
body: <p>I am developing an add-in using VSTO for Microsoft project and I have a managed c++ dll that wraps an un-managed c++ dll.  I need to deploy two versions of the managed c++ dll one for 64 bit and one for 32 bit.  I am using Assembly.LoadFrom(path) to load the appropriate dll depending on which version of Office I am running from. This all seems to work fine on my development machine which is a 64 bit machine running 64 bit office. Below is the code in question: </p>
  
  <pre><code>        try
          {
             //This will return true so I know the file exists
              bool fileExists = File.Exists(path);
              //This will throw a file not found exception
               keyModAssembly = Assembly.LoadFrom(path);
  
          }
          catch (FileNotFoundException e)
          {
  
          }  
  </code></pre>
  
  <p>I have triple checked the path and the file exists and is the correct 32 bit dll. This all works fine on my 64 bit machine but fails in xpmode when I am trying to test it for 32 bit versions.</p>
  
  <p>any suggestions would be greatly appreciated.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>In response to Phillip's suggestion about the unmanaged dll possibly not being found I am loading the unmanaged dll into scope using the LoadLibraryW(path).</p>
  
  <pre><code>// this is not throwing an exception so I know the unmanaged dll is there. 
  if (!File.Exists(unmanagedPath))
              throw new FileNotFoundException();
  LoadLibraryW(unmangedlibPath);
  </code></pre>