System.Reflection.Assembly.LoadFile - " is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"

0

In my code, I want to create dinamically an istance to an assembly using :

System.Reflection.Assembly myDllAssembly = System.Reflection.Assembly.LoadFile(targetdllpath);

If my target dll is compiled as "AnyCPU", it works succesfully.

Now, I have to compile my target DLL as X86 because it must to use a COM object.

So, LoadFile method returns this error:

" is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"

Can you help me?

c#
reflection
asked on Stack Overflow Oct 25, 2016 by Daniele • edited Oct 25, 2016 by Daniele

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0