title: finding dll for "The specified module could not be found"
body: <p>I have a 32 bit .Net application winform that invokes a C++ dll.  We package the app into an installer and it installs and runs fine on at least 20 or so machines.   The app was originally developed and runs fine on a Win 7 x64 machine (mine). </p>
  
  <p>However when I run it on my bosses desktop (Win 7 x64) the application will not launch. 
  oh yeah...</p>
  
  <p>When I try to launch the application I get a JIT dialog with</p>
  
  <p>System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)</p>
  
  <p>When I run depends on the exe on the bosses machine it says that app exe is x86 but that all the dependent dll at x64 and flags it as an error. When I run depends on the app on my machine the exe and dll are all marked x86.</p>
  
  <p>How could this change between machines?  The installer is just unpacking and copying in the normal way and works fine on plenty of other x64 machines...</p>
  
  <p>naturally it only breaks on his machine which is two hours away and we have a trade show coming up. sigh. 
  very confused...</p>
  
  <p>================= solved ==================</p>
  
  <p>So we fixed it. Finding the missing the dll was a bit tricky. </p>
  
  <p>First of all we goofed and  we ran the wrong version of <a href="http://www.dependencywalker.com/" rel="noreferrer">depends</a> for an x64 box.  So it was incorrectly reporting that the app was looking for x64 dll.  If we had run the correct version I think we would have caught the issue sooner. </p>
  
  <p>What solved it for us was looking at the log of <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="noreferrer">Process Monitor</a> from System Internals.   It logs every file access and registry read.   The log quickly showed a failed read on a Direct X 11 dll.</p>
  
  <p>It turns out that a previous installer from some other app had installed <strong>some</strong> of the DX11 dll. That fooled our installer, and it skipped the DirectX 11 step so we had a missing dll.</p>
  
  <p>Thanks for the help guys!</p>