ExecutionEngineException thrown when loading native dll in c#
Posted
by Axarydax
on Stack Overflow
See other posts from Stack Overflow
or by Axarydax
Published on 2010-04-16T09:00:29Z
Indexed on
2010/04/16
9:03 UTC
Read the original article
Hit count: 416
Hi there. I have a 32-bit .net application that uses a native 32-bit DLL via DllImport(). The native DLL is our internal file analysis library, and I need to use it as porting it to C# would be a problem if people update it (other software uses it).
The problem is that when I try to execute any method in the native DLL I get a System.ExecutionEngineException thrown. In fact, I've reduced the managed application to a simple tester that just calls a native method, but it still fails.
I am on 64-bit Windows 7, but that should not matter as I'm compiling everything as 32-bit binaries.
What is also interesting, when I look at the native DLL in the Dependency Walker, it shows that it can't find msvcr90.dll - but when I open any other of our native DLLs in the Dependency Walker, it can find their referenced msvcr90.dll just fine. Can there by some wrongness in the compilation of native DLL that messss up its DLL references?
© Stack Overflow or respective owner