title: Native DLL Not found
body: <p>I have a program that uses Tesseract to extract text from images. I made a Native C++ DLL that is used in C# via P/Invoke. My C# application is a console x64 based and the DLL is also 64 bit.</p>
  
  <p>After deploying to a Windows Server I receive an error that suggets the DLL (one I've made) does not exists. The error message is below.</p>
  
  <blockquote>
    <p>System.DllNotFoundException: Unable to load DLL 'TesseractX64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Utilities.Finance.PDFParser.PDF.OCRObject.GetUTF8Text(String path, String lang, String imgPath)</p>
  </blockquote>
  
  <p>I know for sure that the DLL exists in that path. The TesseractX64.DLL is placed in the same folder as the C# application so it should work without any issues. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>[HandleProcessCorruptedStateExceptions]
  [DllImport(@"TesseractX64.dll", EntryPoint = "GetUTF8Text", CallingConvention = CallingConvention.Cdecl)]
  private static extern IntPtr GetUTF8Text(string path, string lang, string imgPath);
  </code></pre>
  
  <p>What I have tried so far:</p>
  
  <ol>
  <li>Set the DLLImport path to a relative path for example C:\DLL\Tesseract.DLL. Still same issue. </li>
  <li>Installed Visual C++ 2005 - 2012 both x86 and x64. Still same issue.</li>
  </ol>
  
  <p>It works perfectly fine on my Windows 7 x64 computer that I used to develop the program.</p>