jszoo / tesseractdotnet

Automatically exported from code.google.com/p/tesseractdotnet
0 stars 0 forks source link

System.IO.FileLoadException #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by duce...@gmail.com on 28 Feb 2011 at 2:15

GoogleCodeExporter commented 9 years ago
Thanks vaclav... to your shares!

Original comment by congnguy...@gmail.com on 14 Apr 2011 at 2:26

GoogleCodeExporter commented 9 years ago
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.

Original comment by scholz.f...@googlemail.com on 14 Apr 2011 at 5:03

GoogleCodeExporter commented 9 years ago
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!

Original comment by bart.wit...@gmail.com on 21 Apr 2011 at 10:31

GoogleCodeExporter commented 9 years ago
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.

Original comment by matth...@gmail.com on 30 Apr 2011 at 7:27

GoogleCodeExporter commented 9 years ago
Same problem here,
Please Vaclav, upload somewhere your bin.

Original comment by hexbo...@gmail.com on 6 May 2011 at 9:34

GoogleCodeExporter commented 9 years ago
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.

Original comment by congnguy...@gmail.com on 16 May 2011 at 3:27

GoogleCodeExporter commented 9 years ago
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/TesseractEngineWra
pper/
3. Download “tesseractenginewrapper.h” and copy into root “folder1”
http://code.google.com/p/tesseractdotnet/source/browse/trunk/dotnetwrapper/Tesse
ractEngineWrapper/tesseractenginewrapper.h

4. Download “tesseractenginewrapper.cpp” and copy into root “folder1”
http://code.google.com/p/tesseractdotnet/source/browse/trunk/dotnetwrapper/Tesse
ractEngineWrapper/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

8. Build

Original comment by SFvdMe...@gmail.com on 24 May 2011 at 8:01

GoogleCodeExporter commented 9 years ago
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.

Original comment by phamphih...@gmail.com on 2 Jun 2011 at 3:15

GoogleCodeExporter commented 9 years ago
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!

Original comment by miller...@gmail.com on 17 Jun 2011 at 9:21

GoogleCodeExporter commented 9 years ago
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

Original comment by cocoric...@gmail.com on 23 Jul 2011 at 3:07

GoogleCodeExporter commented 9 years ago
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

Original comment by cocoric...@gmail.com on 23 Jul 2011 at 3:25

GoogleCodeExporter commented 9 years ago
Got mine working by switching from debug to release... 

Original comment by ad...@activeunlimited.com on 25 Nov 2011 at 2:47

GoogleCodeExporter commented 9 years ago
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="1fc8b3b9a1e1
8e3b",type="win32",version="9.0.21022.8" could not be found. Please use 
sxstrace.exe for detailed diagnosis.

Original comment by its....@gmail.com on 4 Dec 2011 at 6:04

GoogleCodeExporter commented 9 years ago
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

Original comment by atobran...@gmail.com on 6 Dec 2011 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
Hi

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

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

Original comment by rida.a...@notebox.ch on 11 Dec 2011 at 10:49

GoogleCodeExporter commented 9 years ago
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

Original comment by atobran...@gmail.com on 11 Dec 2011 at 11:48

GoogleCodeExporter commented 9 years ago
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!

Original comment by mkpotl...@gmail.com on 14 Jan 2012 at 10:55

GoogleCodeExporter commented 9 years ago
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?

Original comment by Evesow...@gmail.com on 10 Aug 2012 at 6:20

GoogleCodeExporter commented 9 years ago
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...

Original comment by atobran...@gmail.com on 10 Aug 2012 at 7:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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.

Original comment by Evesow...@gmail.com on 10 Aug 2012 at 8:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I found this big problem.How to solve this ?
Pls Help

Original comment by scriptic...@gmail.com on 1 Jul 2013 at 1:36

Attachments:

GoogleCodeExporter commented 9 years ago
you must rebuild project and reopen mainform, it will be solve.

Original comment by nong...@svcard.com on 9 Jul 2013 at 6:50