deployment of nuance ocr sdk inside reference wcf service

490 Views Asked by At

I have written the integration code for nuance OCR integration getImageText(String FileName) in Web API. Th code compiles and execute perfectly and gives proper output.

But when I move the same code into web service and call it from Web API controller, I got following exception while execution.

"Could not load file or assembly 'Nuance.OmniPage.CSDK.Objects, Version=20.0.0.0, Culture=neutral, PublicKeyToken=d277acbc760e5eaf' or one of its dependencies. An attempt was made to load a program with an incorrect format."

Target CPU platform is set to Any CPU. Visual Studio target CPU Platform 32 bit. Window 10, 64 bit Operating System.

I have tried to execute the method with each set of nuance SDK binaries i.e x64 and x86 but the issue was not resolved.

2

There are 2 best solutions below

0
On BEST ANSWER

Nuance SDK has a parameterized method that accepts SDK Path. I added a method that accepts the respective SDK path dynamically and initializes the correct instance.

1
On

I had the same problem and fixed it. The web service was configured to load only 64-bit libraries but the Nuance Dlls were 32-bit.

Under Advanced Settings, I had to enable 32-bit applications.