It is a barebones console project, just using the sample code, also manually added tessdata for english.
var engine = new Engine(@"./tessdata", Language.English, EngineMode.Default); var img = TesseractOCR.Pix.Image.LoadFromFile("c:\\test.jpg");
var page = engine.Process(img);
Console.WriteLine("Mean confidence: {0}", page.MeanConfidence);
Console.WriteLine("Text: \r\n{0}", page.Text);
Console.ReadKey();
When run through the debugger, the project runs fine. But if I try to package the project and install it in a new Win11 computer, It gives the error:
Unhandled Exception: System. Reflection. TargetInvocationException: Exception has ben thrown by the target of an invocat:
- - - > System .DLL NotFoundExcention. Failed to find library 'leptonica-1.83.0.dll' for platform ×86
The workaround is to manually add a x86 directory with the bundled leptonica-1.83.0.dll. But this is a workaround, why is it not included in the deployed package?
Edit: I tried same sample project on .NET 7 and the folders get created by the Nuget package, so this problem only applies to Framework Projects.
Reltated to https://github.com/Sicos1977/TesseractOCR/issues/6
Creating a clean Console Project using:
It is a barebones console project, just using the sample code, also manually added tessdata for english.
When run through the debugger, the project runs fine. But if I try to package the project and install it in a new Win11 computer, It gives the error:
The workaround is to manually add a x86 directory with the bundled leptonica-1.83.0.dll. But this is a workaround, why is it not included in the deployed package?
Edit: I tried same sample project on .NET 7 and the folders get created by the Nuget package, so this problem only applies to Framework Projects.