2

I'm running an automated application in WinForms and using Tesseract, when I run on localhost it works perfectly, but when I publish or export the bin folder to another computer, it shows me this error:

System.DIINotFoundException: Failed to find library "leptonica-1.80.0.dll" for platform x86.

in InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName)

in
Interop Runtimelmplementer.LeptonicaApiSignaturesInstance.Leptonica ApiSignaturesImplementation..ctor(LibraryLoader loader)
  1. I already tried to move it to myproject\packages\Tesseract.4.1.1\lib\net45\leptonika-1.80.0.dll. unsuccessfully
  2. already checked .NET versions
  3. I already tried to install the tesseract package in the project's bin folder

3 Answers3

4

Install vc_redist.x86. It worked for me.

Hanaka
  • 119
  • 2
  • 9
  • this seems to have fixed it for me aswell. – Thousand Nov 23 '21 at 19:07
  • Worked for me too, shame it took me hours before finding this post. You can find it here: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 – Bart Vanseer Jun 27 '22 at 20:49
0

Reinstalling tesseract dependency in Visual Studio worked for me. Thanks

0

Had the same problem. I eventually tracked to down to the following line in a user control:

InitializeComponent();

Font font = new Font(new FontFamily("Tahoma"), 9.0F, FontStyle.Regular); // <-- Culprit

I fixed it by postponing the font initialization until after the control is loaded...

this.Load += delegate {
    Font font = new Font(new FontFamily("Tahoma"), 9.0F, FontStyle.Regular);
};