Application that references the FREngine.DotNet.Interop assembly fails with an error: "Unable to cast object of type 'System.__ComObject' to type 'FREngine.IEngine'."

Symptoms

When attempting to run an application that references the FREngine.DotNet.Interop assembly, the application fails with one of the following errors:

  • Unable to cast object of type 'System.__ComObject' to type 'FREngine.IEngine'.
  • 'InprocLoader' does not contain a constructor that takes 0 arguments.
  • 'OutprocLoader' does not contain a constructor that takes 0 arguments.

Cause

The FREngine.DotNet.Interop.dll is an interop assembly intended for use in .NET Core projects. If it is referenced from a .NET Framework project, the specified errors would occur.

Resolution

In .NET Framework projects, the Interop.FREngine.dll assembly should be used. Interop.FREngine.dll is available in multiple versions that correspond to different .NET Framework versions. For instance, if the project uses .NET Framework 4.5, the suitable Interop.FREngine.dll would be found here:

C:\ProgramData\ABBYY\SDK\12\FineReader Engine\Inc\.Net interops\v4.5\Interop.FREngine.dll

All .NET Framework interop assemblies can be found here:

C:\ProgramData\ABBYY\SDK\12\FineReader Engine\Inc\.Net interops

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.