question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Marshaling to and from COM interface pointers isn't supported (.net core 2.1)

See original GitHub issue

centos7 64bit .net core2.1 exception was thrown when running

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal ‘parameter #2’: Invalid managed/unmanaged type combination (Marshaling to and from COM interface pointers isn’t supported). at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr ptr, Type t) at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t) at InteropRuntimeImplementer.TessApiSignaturesInstance.TessApiSignaturesImplementation…ctor(LibraryLoader loader) — End of inner exception stack trace — at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at InteropDotNet.InteropRuntimeImplementer.CreateInstanceT at Tesseract.Interop.TessApi.Initialize() at Tesseract.Interop.TessApi.get_Native() at Tesseract.TesseractEngine…ctor(String datapath, String language, EngineMode engineMode, IEnumerable1 configFiles, IDictionary2 initialOptions, Boolean setOnlyNonDebugVariables) at TesseractCore.Program.Main(String[] args)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
charleswcommented, Sep 5, 2018

Yes thanks for the info I’ll have a look at why that call fails and see if we can get a linux build together.

On Tue., 4 Sep. 2018, 03:16 HelgeL, notifications@github.com wrote:

Thanks for info stdcall! I tried that too and now the code works on Unix.

Btw I got to read the Trace output by just putting Console.WriteLines in Logger.cs.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/charlesw/tesseract/issues/433#issuecomment-418164476, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPzyLRHCIWPj2YBMNtB06uLVJspp_ipks5uXWQFgaJpZM4VoNQB .

1reaction
stdcallcommented, Aug 31, 2018

Well, my code started to work after commenting BaseAPIProcessPage declaration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Marshal.GetComInterfaceForObject Method
Returns a pointer to an IUnknown interface that represents the specified interface on the specified object. Custom query interface access is enabled by...
Read more >
Marshaling to and from COM interface pointers isn't ...
Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #2': Invalid managed/unmanaged type combination (Marshaling to and ...
Read more >
SWIG & MarshalDirectiveException: Marshaling to and ...
I'm using SWIG to store C# managed callback functions inside an unmanaged class. Then, I'm calling an unmanaged method (say, e.g., ...
Read more >
Span<T> for Audio
Of course one big block to the adoption of Span<T> is that it is currently supported on .NET Core 2.1 only. It's not...
Read more >
Writing High-Performance Code Using Span<T> and ...
Unmanaged memory: Resides in the unmanaged heap and is allocated by calling the Marshal.AllocHGlobal or Marshal.AllocCoTaskMem methods. Newly Added Types in .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found