-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When compiled as an exe TesseractEngine won't initialize #609
Comments
I am having the same problem using .NET 6 and Windows Forms. Debugging works just fine but when publishing, it wont run. Did you manage to make it work? This is my Error
|
I got it to run by using |
Didn't work for me |
https://github.com/gyfprivate/tesseract |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a .NET 6 console app. With Tesseract and Tesseract.Drawing Version 4.1.1
It will work when debugging and
dotnet run
It will not work with -p:PublishSingleFile=true set but will run without it.
It will not work when I publish it as an exe using this.
dotnet publish --output "C:\" --runtime win-x64 --configuration Release -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true
It fails on
var engine = new TesseractEngine(@"./tessdata", "eng", EngineMode.Default))
The training data is in that folder it is the same folder the executable is being run.
I have tried using
Directory.GetCurrentDirectory()
as the path.I have tried having the training data in the same folder as the executable with
@"."
path.All these methods work when debugging but not when published as a single file executable.
The text was updated successfully, but these errors were encountered: