1

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.

YanetP1988
  • 1,346
  • 3
  • 18
  • 43
Abhishek Pandey
  • 338
  • 1
  • 3
  • 13

2 Answers2

0

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.

Chris
  • 1
  • 1
  • Hi Chris, I had resolved it by creating a method which dynamically passes the SDK path as parameter while initializing services. Thanks for the reply. – Abhishek Pandey Sep 09 '18 at 23:55
0

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.

Abhishek Pandey
  • 338
  • 1
  • 3
  • 13