Exception with Aspose OCR in net48

Hello,

I am trying your OCR library before purchase, and I have a problem with it for a net48 project.
(For net8.0 it’s working fine)

When using ‘api.Recognize(input);’ there is a null pointer exception that is thrown in the transitive library Microsoft.ML.OnnxRuntime.

Error is ‘The given version [14] is not supported, only version 1 to 10 is supported in this build.’

In your documentation, it states that Aspose OCR is compatible with .net48 so I’m writing to you for a solution.

You can easily reproduce the problem by modifying your example project ‘PerformOCROnImage’ and change the project framework to net48
How to run examples|Documentation
https://github.com/aspose-ocr/Aspose.OCR-for-.NET/archive/master.zip

I’m using the latest version 24.6.0 but I’ve tried lower version too with same error.

Thank you in Advance for the help.

Have a great day,

@atinard

We are checking it and will get back to you shortly.

@atinard

Can you please sure that you tried with x64 mode of debugging instead of x86?

Hello, Thank you for your answer,

I’m targeting the ‘AnyCPU’ plateform, so Aspose OCR should automatically choose the right Microsoft.ML.OnnxRuntime.

Thanks again in advance

@atinard

Thanks for the information. We will let you know after performing some investigation.

@atinard

It can be due to AnyCPU targeting x32 prefer. It can be the real issue at your end. Please try to set One thread settings and uncheck the checkbox with x32 bit prefer (it is for Any CPU).

List<RecognitionResult> result = api.Recognize(input, new RecognitionSettings { ThreadsCount = 1 });

image_2024_06_25T06_58_13_760Z.png (10.7 KB)