In my program on this line:
int value = MTEConnect(auth_string, err);
I get this exemption:
FatalExecutionEngineError The runtime has encountered a fatal error. The address of the error was at 0x68c8a681, on thread 0x2334. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
MTEConnect is imported this way:
[DllImport("mtesrl.dll", CharSet = CharSet.Ansi)] private static extern int MTEConnect(String pars, StringBuilder err);
What is the problem and how to fix it?
upd: I can reproduce the same problem on another machine, but I received a slightly more detailed message:
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\blahblah\MBClient\bin\Debug\MBClient.vshost.exe
The library itself is functional, because it can be used from other applications, I just can not use it from C #
source share