Unable to load the Managed C++ dll into C# Dll

1

I have a C# application which is built with platform target as ANY CPU. It references a managed C++ application which is built with the platform target as Win32. However the loading of the C++ dll fails at runtime with the following error. "Could not load file or assembly 'abc_Debug, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to access invalid address. (Exception from HRESULT: 0x800701E7)"

Can anyone give me some pointers as to what could be wrong?

c#
asked on Stack Overflow Feb 1, 2011 by Sapna

2 Answers

1

If you are running the application at a x64 architecture then your app is starting as x64 and then it can't load the c++ reference. You cannot build an application as AnyCpu if you don't have all the dependences available for AnyCpu, otherwise set x86 as the target.

0

in general for any loading problem of managed dlls, it's better to use fuslogvw it can gives you more details.

answered on Stack Overflow Feb 1, 2011 by DesignFirst

User contributions licensed under CC BY-SA 3.0