Search code examples
c#.netwcfasp.net-web-apinuance

deployment of nuance ocr sdk inside reference wcf service


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.


Solution

  • 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.