Export to GitHub

tesseractdotnet - issue #1

System.IO.FileLoadException


Posted on Feb 28, 2011 by Grumpy Monkey

What steps will reproduce the problem? 1. Create new WinForms project 2. Add reference to tesseractengine3.dll 3. var x = new TesseractProcessor();

What is the expected output? What do you see instead? Main form window

What version of the product are you using? On what operating system? RC

Please provide any additional information below. Thrown System.IO.FileLoadException This exception is thrown if the file is not a valid .NET Framework assembly.

Many thanx for this library. I search for something last 2 week.

Comment #1

Posted on Mar 1, 2011 by Grumpy Wombat

Please help me to check that Leptonica library has already been copied to application path first.

Comment #2

Posted on Mar 1, 2011 by Grumpy Wombat

Comment deleted

Comment #3

Posted on Mar 1, 2011 by Grumpy Monkey

Yes leptonlibd.dll and tesseractengine3.dll in same folder.

There my exception text translate:

System.IO.FileLoadException: Error in loading "tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" or one of it dependency. Parallel configuration wrong.

Filename: "tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" ---> System.Runtime.InteropServices.COMException (0x800736B1): Parallel configuration wrong. (Exception from из HRESULT: 0x800736B1) в MODITest.Form1.Form1_Load(Object sender, EventArgs e) в System.Windows.Forms.Form.OnLoad(EventArgs e) в System.Windows.Forms.Form.OnCreateControl() в System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) в System.Windows.Forms.Control.CreateControl() в System.Windows.Forms.Control.WmShowWindow(Message& m) в System.Windows.Forms.Control.WndProc(Message& m) в System.Windows.Forms.ScrollableControl.WndProc(Message& m) в System.Windows.Forms.ContainerControl.WndProc(Message& m) в System.Windows.Forms.Form.WmShowWindow(Message& m) в System.Windows.Forms.Form.WndProc(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Comment #4

Posted on Mar 1, 2011 by Grumpy Wombat

Sorry, I cannot reproduce the problems. Please check your settings or can you send to me the project? Thanks!

Comment #5

Posted on Mar 1, 2011 by Grumpy Monkey

Which settings I need to check? May be I do something wrong. I not so strong in InterOp. Project is simple form with 1 button. Here it is http://www.filehosting.org/file/details/207180/TesswraperTest.zip Sample app from RC archive throws same exception. Windows 7 x32, VS 2010

Comment #6

Posted on Mar 1, 2011 by Grumpy Wombat

The project you provided, I run without problems. Please check your ide enviroment.

Comment #7

Posted on Mar 1, 2011 by Grumpy Monkey

I find that http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/692915bc-54e6-4b09-8b32-92d16c2afaaf/

May be your lib compilated on another processor architecture? Or missing some dlls?

Comment #8

Posted on Mar 1, 2011 by Grumpy Monkey

I found similar problem on russian MSDN. Library and my project must be compiled as Release configuration. I set Release, but exception still throwing.

http://social.msdn.microsoft.com/Forums/ru-RU/fordesktopru/thread/16ddcf3d-a83b-4dcb-8949-f088a284b929/

Comment #9

Posted on Mar 1, 2011 by Grumpy Wombat

Have you tried to build engine wrapper? I ask this because I don't sure about assembly I provided, is compatible with your machine.

If not yet, please try to create an engine wrapper first, you can find tutorial at here: http://code.google.com/p/tesseractdotnet/wiki/TesseractEngineWrapper

Thanks for your cooperation.

Comment #10

Posted on Mar 1, 2011 by Grumpy Monkey

I have not C++ in my VS 2010 And I can not find "Common Language Runtime Support: Old Syntax (/clr:oldSyntax)" in my project properties.

Comment #11

Posted on Mar 1, 2011 by Swift Ox

duce, I was also able to run your test application without a problem

Comment #12

Posted on Mar 1, 2011 by Grumpy Monkey

At home VS throw the same exception on my project and on your sample app. This can't be a coincidence. Thanks anyway for your help.

Comment #13

Posted on Mar 1, 2011 by Grumpy Monkey

Rather my app throw same exception, and your sample app throw System.BadImageFormatException

Comment #14

Posted on Mar 2, 2011 by Grumpy Wombat

The tesseractenginewrapper3.dll is built for x86. You can changed tesseract project settings to build for Any CPU.

System.BadImageFormatException was throwed when an executable (manged code) built with Any CPU tried to load a dll build with x86.

Comment #15

Posted on Mar 2, 2011 by Grumpy Wombat

"Common Language Runtime Support: Old Syntax (/clr:oldSyntax)" is only in C++ project.

Comment #16

Posted on Mar 2, 2011 by Grumpy Monkey

I tryed all of project settings. AnyCPU and x86. On VS2010 with C# and with C# and C++. On 64 processor architecture and 32. On Windows7 and Windows 2008 Server R2. Install C++ Redist 2005, 2008, 2010. No effect.

I use sxstrace.exe utility for trace error.

Error: can not resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"

For what purposes in manifest uses Microsoft.VC90.DebugCRT?

Comment #17

Posted on Mar 2, 2011 by Grumpy Wombat

Dear ducebod, As I commented on item #9: "I don't sure about assembly I provided, is compatible with your machine."

So, you should install c++ ide (vs 2008), and try to do a wrapper. If you get problems during do it, I can support.

Cong.

Comment #18

Posted on Mar 4, 2011 by Helpful Panda

Good evening,

I have the exact same error at work (XP SP3 x86). At home, it works fine (Vista SP1 x86). I tried recompiling the wrapper using the method described in the wiki page. It was actually harder than the prescribed method. First, there was a missing include (I added a comment about that in the wiki page). Then, /Zi and /Gm flags were unsupported (so said VC++, I haven't developped C++ for almost 2 years and after this fancy adventure I guess I'm not ever doing that again). Anyway, after turning /Zi to /Z7 and /Gm to /Gm-, it compiled.

But using it w/ C#.NET 4 still does not work - same error comes up.

I would gladly do anything to get this working. I recently did the mistake of installing Tesseract 3 which messed up Tesseract .NET 2 wrapper (there's a thread about this upon the Tesseract google forum) and considering this cause - consequence, I do not think Tesseract 2 .NET wrapper is really suitable for any use beside experimental ones. I have great expectancies about your project, Mr N'Guyen, and I would like to add I'm very grateful to you to have such an enterprise.

Best regards, Benjamin Neau

Comment #19

Posted on Mar 5, 2011 by Grumpy Wombat

Benjamin, You can find solution here for your issue: http://code.google.com/p/tesseractdotnet/issues/detail?id=2&can=7

Comment #20

Posted on Mar 5, 2011 by Grumpy Monkey

I find machine with 32 bit XP and install VS 2008 C++ Express edition. But it not opens your solution. "The project maked in newer version of VS". Which version you using?

Comment #21

Posted on Mar 5, 2011 by Grumpy Wombat

My IDE version is "Visual Studio Team System 2008 SP1". (version 9.0.21022.8 RTM)

Comment #22

Posted on Mar 5, 2011 by Helpful Panda

Cong,

It does not fix my problem. The missing include is something I already solved. My issue is that the assembly you provide or the ones I compiled cannot be loaded.

Here is the exception I get while trying to use the wrapper in a C# program: System.IO.FileLoadException: Could not load file or assembly 'tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

As i stated earlier in this thread: - I tried out your sample application at work (XP SP3 x86) -> it does not work - I tried out your sample application at home (Vista SP1 x86) -> it does work - I recompiled the wrapper (debug) - I tried out your sample application at work (XP SP3 x86) with my recompiled wrapper -> it does not work - I tried out your sample application at home (Vista SP1 x86) with my recompiled wrapper -> it does not work

Thanks for your time and consideration!

Best regards, Benjamin

Comment #23

Posted on Mar 5, 2011 by Massive Ox

@benjamin: there must be something else: I installed VS #C 2008 just because of tesseractengine3 and it worked (I just need to set #include as mentioned above). Interesting part of error message is "The system cannot find the file specified." Do you have leptonica library in path (leptonlib.dll and leptonlibd.dll)? Can you find out what file system can not find?

Comment #24

Posted on Mar 5, 2011 by Grumpy Monkey

I have same exception

I use sxstrace.exe utility for trace error.

Error: can not resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"

And I don't found leptonlibD.dll file in RC version. Just one leptonlib.dll

Comment #25

Posted on Mar 6, 2011 by Massive Ox

leptonlibd is leptonica debug library. You can find it in source code: http://code.google.com/p/tesseractdotnet/source/browse/trunk/dotnetwrapper/TesseractBasedOCRAnalysis/Components/leptonlibd.dll

It must be in PATH (e.g. in the same directory where is you exe and tesseractengine3.dll or in system PATH directory. There are plenty information about PATH on internet e.g. http://en.wikipedia.org/wiki/Environment_variable, http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/path.mspx?mfr=true, http://vlaurie.com/computers2/Articles/environment.htm)

Comment #26

Posted on Mar 6, 2011 by Grumpy Monkey

Thanks for help But exception still throwing :(

Comment #27

Posted on Mar 6, 2011 by Quick Cat

Comment deleted

Comment #28

Posted on Mar 6, 2011 by Quick Cat

Can you help me? A error appears ("Fail to initalize Tesseract Engine 3.01") when I choose the path of trained languages for tesseract 3 (from main menu >> tools >> options in TesseractEngine3Wrapper_v1.0RC application). I downloaded them from http://code.google.com/p/tesseract-ocr/downloads/list.

Comment #29

Posted on Mar 6, 2011 by Grumpy Wombat

Dear all,

Some things as belows will help me to isolate the issue easily:

I will support if you cannot build a wrapper.

If you get error when run example application, please help me collect the exception information included: message and stacktrace.

Cong.

Comment #30

Posted on Mar 6, 2011 by Grumpy Monkey

Error when run example application

Stack trace: в Tesseract.OCR.AppEntry.MainForm.End() в Tesseract.OCR.AppEntry.MainForm.Dispose(Boolean disposing) в System.ComponentModel.Component.Finalize()

Message: Could not load file or assembly "tesseractengine3, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null" or one dependent upon the components. Attempt was made to load the program with an incorrect format.

Windows 7 x64, Windows 7 x32 Visual Studio 2010 C# C++ redist 2005, 2008, 2010 installed

Comment #31

Posted on Mar 6, 2011 by Massive Ox

@phamphih: you are mixing versions! http://code.google.com/p/tesseract-ocr/downloads/list has language files for 3.00 version! 3.01 language files are in svn only (at the moment): http://code.google.com/p/tesseract-ocr/source/browse/#svn%2Ftrunk%2Ftessdata.

Language files tesseract-ocr 3.00 and 3.01 are not compatible!

Comment #32

Posted on Mar 7, 2011 by Grumpy Wombat

@duce..: sorry, we have not through out issue for a long time.

I want to confirm that: - should not use assembly I have provide due to compatibles are not manage with private machine. (It should be a demo/example only.) - Can you pass building a wrapper with all things I noted above (use sources/data/third party from svn).

If all things are yup, I will try to get another machine (new machine without related tesseract) to reproduce your problems.

Cong.

Comment #33

Posted on Mar 7, 2011 by Grumpy Wombat

@Zdenko: thank you so much! So far you have helped me much!

Comment #34

Posted on Mar 7, 2011 by Quick Cat

Comment deleted

Comment #35

Posted on Mar 7, 2011 by Grumpy Monkey

@congnguy thanks for help Now I will install on virtual machine Vista and try to do wrapper

Comment #36

Posted on Mar 7, 2011 by Grumpy Monkey

I confused in instruction how to do wrapper. 1. From tesseract-ocr SVN download tesseract sources in folder1 2. Copy and override files from "tesseractdotnet - Revision 40: /trunk/dotnetwrapper/TesseractEngineWrapper" into folder1 3. Open downloaded tesseract project in VS, "Add existing item" (tesseractenginewrapper.h and tesseractenginewrapper.cpp) into root of project 4. Change settings 5. Build Right?

May I use Visual Studio 2010 C++ Ultimate to do that?

Comment #37

Posted on Mar 7, 2011 by Quick Cat

I downloaded traineddata languages from http://tesseract-ocr.googlecode.com/svn/trunk/tessdata (use svn checkout)but TesseractEngine3Wrapper_v1.0RC is still appear "Fail to initalize Tesseract Engine 3.01" message. Even, with the statement : bool status = _ocrProcessor.Init(); status is also = "false".

Can you help me to resolve above problem?

I downloaded the latest projects source code from "http://tesseractdotnet.googlecode.com/svn/trunk/" and "http://tesseract-ocr.googlecode.com/svn/trunk/".

Comment #38

Posted on Mar 7, 2011 by Grumpy Wombat

@duce: Yup, it's right. I want to clarify all steps here: 1. ok (v3.01 r552) 2. You have to search 3 files name to find sub folder respectively. 3. you have to open solution in folder1\vs2008\tesseract.sln -> add 2 files to tesseract project 4. ok 5. ok

@phamhih: TessBaseAPI provides Init() method and return the intialize status, not other messages. So with your message I cannot figure out problems here.

Did you use tesseract.exe (v3.01 in .\vs2008\bin.debug) command line? If yes: are the same prblem? else: please try it first and report the results. Here is tesseract-ocr document: http://code.google.com/p/tesseract-ocr/wiki/ReadMe

Thanks, Cong.

Comment #39

Posted on Mar 7, 2011 by Grumpy Monkey

Another question about changing settings while building wrapper: Output File: tesseractengine3.dll - did you mean Linker->Output file or Browse information->Output file? I do not know С++ I chose Linker subitem. And after building (no errors - Build: 13 succeeded, 0 failed, 0 up-to-date, 0 skipped ) I get tesseractengine3.dll in folder1/vs2008 folder What to do next?

Thanks again for your help

Comment #40

Posted on Mar 7, 2011 by Grumpy Wombat

@duce: Yup, it's "Linker->Output file": tesseractengine3.dll (or any name if you want).

Now, add Tesseract.OCR.AppEntry into solution. And right-click on References->switch to Properties tab -> Choose tesseract.

Copy liptonica library to output folder of Tesseract.OCR.AppEntry project if it does not exist, mark this project as Startup project.

Right-click on this project -> Choose Properties -> switch to Debug tab -> check to "Enable unmanaged code debugging" -> it will help you to debug into deep c++ level.

Configure project to build for x86 platform.

Hope it succeed :)

Comment #41

Posted on Mar 7, 2011 by Grumpy Monkey

Comment deleted

Comment #42

Posted on Mar 7, 2011 by Grumpy Monkey

@congnguy References->Projects you means?

All completed Now at the start I get same exception as early. Thats Output info:

............ 'Tesseract.OCR.AppEntry.exe': Loaded 'D:\Downloads\TesseractEngine3Wrapper_v1.0RC NEW\dotnetwrapper\TesseractBasedOCRAnalysis\bin\Debug\tesseractengine3.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll' Module not found. (Exception from HRESULT: 0x8007007E) [My tranlation from rus] 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'D:\Downloads\TesseractEngine3Wrapper_v1.0RC NEW\dotnetwrapper\TesseractBasedOCRAnalysis\bin\Debug\tesseractengine3.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\SysWOW64\ws2_32.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\SysWOW64\nsi.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll' First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: HRException at memory location 0x0027dbbc.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. A first chance exception of type 'System.IO.FileNotFoundException' occurred in Tesseract.OCR.AppEntry.exe 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll' в Tesseract.OCR.AppEntry.MainForm..ctor() в Tesseract.OCR.AppEntry.Program.Main() в D:\Downloads\TesseractEngine3Wrapper_v1.0RC NEW\dotnetwrapper\TesseractBasedOCRAnalysis\Tesseract.OCR.AppEntry\Program.cs:строка 36 'Tesseract.OCR.AppEntry.exe': Loaded 'D:\Downloads\TesseractEngine3Wrapper_v1.0RC NEW\dotnetwrapper\TesseractBasedOCRAnalysis\bin\Debug\tesseractengine3.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll' 'Tesseract.OCR.AppEntry.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'D:\Downloads\TesseractEngine3Wrapper_v1.0RC NEW\dotnetwrapper\TesseractBasedOCRAnalysis\bin\Debug\tesseractengine3.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\SysWOW64\ws2_32.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\SysWOW64\nsi.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll' 'Tesseract.OCR.AppEntry.exe': Unloaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll' First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: HRException at memory location 0x0455e1d8.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x74f8b727 in Tesseract.OCR.AppEntry.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. A first chance exception of type 'System.IO.FileNotFoundException' occurred in Tesseract.OCR.AppEntry.exe An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Tesseract.OCR.AppEntry.exe

Additional information: Не найден указанный модуль. (Исключение из HRESULT: 0x8007007E)

The program '[2684] Tesseract.OCR.AppEntry.exe: Managed' has exited with code 0 (0x0). The program '[2684] Tesseract.OCR.AppEntry.exe: Native' has exited with code 0 (0x0).

Comment #43

Posted on Mar 7, 2011 by Grumpy Monkey

Additional information: Не найден указанный модуль. (Исключение из HRESULT: 0x8007007E)

Additional information: Module not found. (Exception from HRESULT: 0x8007007E)

Comment #44

Posted on Mar 29, 2011 by Happy Elephant

Is there already a solution for the problem? Is it not possible to build a dll for x86 and another for x64?

Your Projekt is very nice. Iam waiting so long for a tesseract 3 wrapper!!

Comment #45

Posted on Apr 8, 2011 by Grumpy Panda

to Duce : Duce have you solved your problem with exception "System.IO.FileLoadException: Error in loading "tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" or one of it dependency." ? Because I have the same problem as you and I don`t know what I do wrong.

Thank you for help.

Comment #46

Posted on Apr 8, 2011 by Grumpy Monkey

No, my problem not solved.

Comment #47

Posted on Apr 11, 2011 by Happy Horse

Duce, I had the same problem. Problem was fixed by installing Visual C++ 2008 Express Edition (http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe). But tesseractengine3.dll works only if VC++ 2008 is installed. I don't know how to make it work without it... I tried to compile dll staticly but it was no effect...

Comment #48

Posted on Apr 11, 2011 by Happy Elephant

With C++ 2010 Express it is also working. But not with VS2010 Ultimate...

Comment #49

Posted on Apr 13, 2011 by Grumpy Wombat

I have not reproduced the problem (System.IO.FileLoadException) on a new machine (OS: win7 64, IDE: vs team system 2008).

I have two scenarios: 1. Configure Application build to "Any CPU" platform => throw out exception: System.BadImageFormatException

  1. Configure Application build to "x86" => no problems here

Comment #50

Posted on Apr 13, 2011 by Grumpy Panda

Hello guys,

my troubles with "System.IO.FileLoadException: Error in loading "tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" or one of it dependency." seems to be solved. Zdenko helped me via email and I want to share with you the new facts. I have Visual Studio 2010 and Win XP with SP3. I try to explain it in following steps

  1. I downloaded the last version of tesseract-ocr from svn (http://tesseract-ocr.googlecode.com/svn/trunk/). Be carefull in "Download" section was missing some kind of project (.vcxproj).

  2. Start vs2008\tesseract.sln and automatically was converted solution from VS 2008 to VS 2010 without errors.

  3. I set tesseract project by this tutorial http://code.google.com/p/tesseractdotnet/wiki/TesseractEngineWrapper

  4. After build of solution, I got the new tesseractengine3.dll and I replaced old tesseractengine3.dll in dotnetwrapper/TesseractBasedOCRAnalysis

  5. dotnetwrapper example ran without exception. :-)

These steps helped me and solved my problem with System.IO.FileLoadException. Zdenko thanks :-)

V.

Comment #51

Posted on Apr 14, 2011 by Grumpy Wombat

Thanks vaclav... to your shares!

Comment #52

Posted on Apr 14, 2011 by Happy Elephant

Compiling the test project with debug x86 I get the following error: System.IO.FileNotFoundException was not treated.

With Debug Any CPU: System.BadImageFormatException was not treated.

With release I can compile x86 and Any CPU but the OCR does not work in the program.

I hope we manage to create a working and stable library.

Comment #53

Posted on Apr 21, 2011 by Happy Cat

Hey Vaclav,

I have the same problem like you had...

I tried the steps but I wast'n able to build and generate the tesseractengine3.dll.

Would you want to send me yours pls?

Thanks!

Comment #54

Posted on Apr 30, 2011 by Happy Rhino

Yes, please someone post a working DLL for .NET. I've been screwing around with this for a few hours now, and it seems like a waste, since all I need is the compiled DLL. The one included with the package doesn't work.

Comment #55

Posted on May 6, 2011 by Happy Cat

Same problem here, Please Vaclav, upload somewhere your bin.

Comment #56

Posted on May 16, 2011 by Grumpy Wombat

Sorry for long time no updating project!

I don't have time to work on project now!

So I have released the version included the work space I have worked on!

Hope that it will resolve existed issues!

Cong.

Comment #57

Posted on May 24, 2011 by Quick Bear

I confused in instruction how to do wrapper.

  1. From tesseract-ocr SVN download tesseract sources in “folder1” http://tesseract-ocr.googlecode.com/svn/trunk/
  2. Copy and override files from "tesseractdotnet - Revision 41” into “folder1\ccmain” http://tesseractdotnet.googlecode.com/svn/trunk/dotnetwrapper/TesseractEngineWrapper/
  3. Download “tesseractenginewrapper.h” and copy into root “folder1” http://code.google.com/p/tesseractdotnet/source/browse/trunk/dotnetwrapper/TesseractEngineWrapper/tesseractenginewrapper.h

  4. Download “tesseractenginewrapper.cpp” and copy into root “folder1” http://code.google.com/p/tesseractdotnet/source/browse/trunk/dotnetwrapper/TesseractEngineWrapper/tesseractenginewrapper.cpp

  5. Open solution in “folder1\vs2008\tesseract.sln” in VS2010 C++

(????? on which one in the property page) 6. Changed the project settings as below: (????? on which one in the property page)

  • Configuration properties / General / Configuration Type = Dynamic Library (.dll)

  • Configuration properties / General / Common Language Runtime Support = Old Syntax (/clr:oldSyntax)

  • Linker / Output file = tesseractengine3.dll

(????? ) 7. Also need to add System, System.Drawing assembly to Common Properties\Framework and References

  1. Build

Comment #58

Posted on Jun 2, 2011 by Quick Cat

I used tesseract3.dll in my web service application. When I publish web site, a error appeared "The specified module could not be found (Exception from HRESULT 0x8007007E)" Please help me to resolve this problem.

Comment #59

Posted on Jun 17, 2011 by Happy Giraffe

Has anyone been able to get a tesseract3.dll to work in the TesseractBasedOCRAnalysis app within VS-2010 Ultimate? I have been able to resolve the issues where the project could not find leptonlibd.dll and tesseractengine3.dll (by copying DLLs into the execution path). However, my latest error while debugging is...

An unhandled exception of type 'System.IO.FileLoadException' occurred in Tesseract-OCR-AppEntry.exe. Additional information: Mixed mode assembly is built against version v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

I have attempted to download all suggestions of tesseractengine3.dll above with no success in resolving this error.

WHOEVER HAS A WORKING .NET 4.0 tesseractengine3.dll...please upload to share. I think all of us are attempting the same thing struggling with version issues over hundreds of files in order to compile "tesseract-ocr revision 589". I think we are all searching for the same thing...a working 3.01 DLL just like the 2.04 version (which works fine in NET 2.0, VS 2008...if that's a working solution for you).

Thanks for your help!

Comment #60

Posted on Jul 23, 2011 by Happy Bird

Hello, First of all, thanks congnguy for your work ! Unfortunately I have the same issue than phamphih and duce : "Exception de HRESULT : 0x8007007E", (Module Not found)

I have tried a very simple console application class Program { static void Main(string[] args) { var x = new TesseractProcessor(); } } Nothing more. The project build, but refuses to start!

I use VS2008 Professional Edition on Windows 7

Does anyone know how to find out the module the CLR is searching? Thanks

Comment #61

Posted on Jul 23, 2011 by Happy Bird

HRESULT : 0x8007007E issue.

Hi again, After struggling for almost one hour an posting the previous comment I finally added "leptonlibd.dll" in the output file.

My testing console program as well as the Tesseract.OCR.AppEntry works fine!

For those who like me read the comments too quickly, try add "leptonlibd.dll" in the output file.

Regards

Comment #62

Posted on Nov 25, 2011 by Grumpy Hippo

Got mine working by switching from debug to release...

Comment #63

Posted on Dec 4, 2011 by Helpful Cat

Using a release version of tesseractengine3.dll also resolved the exception I was seeing, thanks for the tip #62!

Could not load file or assembly 'tesseractengine3.dll' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

Activation context generation failed for "tesseractengine3.dll". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.

Comment #64

Posted on Dec 6, 2011 by Swift Rhino

Hi everyone,

I ran into a lot (most) of the same problems described in this thread. I was finally able to get the solution to compile and run on a 64bit multi processor machine with VS 2010. I don't remember all of the changes I had to make to get it to work, but here's a link to the zip file: http://www.mediafire.com/?ddcf4daj1u5ddca I was going to add it as an attachment here, but the file size is limited to 10MB. The .sln file to open is in the vs2008 folder. I tried renaming it to vs2010 one time and started over since I thought it might have caused problems. One thing I couldn't figure out was the fact that you will have to manually delete the tmp folder every time you build the tesseract project. I tried adding a pre build event to do this automatically and I guess my syntax wasn't quite right. If all you're interested in is the DLL, I replaced the version in the precompiled assemblies folder with the one that I built. It's also attached to this post. I'm no expert at this type thing (I've mainly worked directly with C# and .NET in the past), but if anyone has questions I'll do my best to help.

HTH, Brandon

Attachments

Comment #65

Posted on Dec 11, 2011 by Grumpy Rhino

Hi

My config: 64bit multiprocessor, win7 ultimate, visual studio 2010 ultimate I downloaded tesseract project here: http://tesseractdotnet.googlecode.com/svn/trunk/dotnetwrapper/TesseractBasedOCRAnalysis

Hitting F5 gives error: Could not load file or assembly 'tesseractengine3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)

Printscreen of issue: http://screencast.com/t/2qJLZysp4

I'm a beginner of c#...never done c++

I'd appreciate your help

Comment #66

Posted on Dec 11, 2011 by Swift Rhino

Hi Rida,

I wasn't able to get the TesseractBasedOCRAnalysis project to work either. That's when I started over and tried to get the code for the C# wrapper to build. Do you have any errors when trying to build the project I uploaded at http://www.mediafire.com/?ddcf4daj1u5ddca ? If you want the console app example to run make sure you update the file paths in the code to point to the proper location on your computer. If I remember correctly there are 4 things you need to change: 1. The path to the image you want to do the OCR on and extract the text. 2. The path to the same image so it can be used to draw the layout rectangles. 3. The path to the language files. 4. The path to the output image that shows the rectangles around the letters and words. I hope this helps... If you have more questions I can try to answer from work tomorrow where I will have access to the code. I am writing to you from home now.

Thanks, Brandon

Comment #67

Posted on Jan 14, 2012 by Massive Horse

Hi Rida,

I ran into the tesseractengine3 load failure as well. It turns out, default configuration of the managed application has Platform Target set to "Auto", change it to "x86" and load failure will go away. Reason for this is, tesseractengine3.dll is built for x86 so, "Auto" executable and x86 dependency runs in to collision when app runs on 64-bit windows. I got the app running after fixing this issue.

Hope that fixes yours!

Comment #68

Posted on Aug 10, 2012 by Swift Camel

So when someone is trying to deal with the 0x8007007E error and they say: "add "leptonlibd.dll" in the output file" what does that mean exactly? Add it where/how?

Comment #69

Posted on Aug 10, 2012 by Swift Rhino

Try putting it in whatever folder the exe is in or the bin folder where all of the other DLLs are (if there is one). It's been a long time since I did anything with this and I'm not at work so I can have a look at the folder structure, so I hope my comment at least gives you something to try...

Comment #70

Posted on Aug 10, 2012 by Swift Camel

Comment deleted

Comment #71

Posted on Aug 10, 2012 by Swift Camel

OK....seems I am an idiot. I needed to include the liblept168 project in the build and the DLL no longer results in a problems for the application.

Comment #72

Posted on Aug 15, 2012 by Swift Lion

Comment deleted

Comment #73

Posted on Mar 28, 2013 by Helpful Horse

Comment deleted

Comment #74

Posted on Jul 1, 2013 by Helpful Monkey

I found this big problem.How to solve this ? Pls Help

Attachments

Comment #75

Posted on Jul 9, 2013 by Quick Wombat

you must rebuild project and reopen mainform, it will be solve.

Status: Started

Labels:
Type-Defect Priority-Medium