Native loading works good. Loading from .net gives error Unable to load DLL 'my.dll': Invalid access to memory location
I'm trying to use native dll, using DllImport. And I receive such error. System.DllNotFoundException: Unable to load DLL 'my.dll': Invalid access to memory location. (Exception from HRESULT: 0x800703E6) That dll loads normally when is called from native code (it is used from delphi app). But when I call it from .net code, it gives me exception above. I've read this link Windows Vista: Unable to load DLL 'x.dll': Invalid access to memory location. (DllNotFoundException) , but no solution helps. DEP, Administration rights are not the case. P.S. This situation occurs on Windows 2008 server. On