A
Ananas
Hi,
I work with native code over the PInvoke. The problem is when I link
the 32bit native library I have to switch "Platform target" to x86 to
avoid the BadImageFormatException. At this point my assembly becomes
32bit (=x86) and all assemblies referencing this assembly should also
be 32bit (=x86), otherwise I get BadImageFormatException.
Is it possible in some way to leave the assembly in the x64 world but
link 32bit dll using PInvoke?
I have an idea, but I do not like it. I have created the wrapping
native library on C++ that links another library explicitly in runtime
by LoadLibrary(...). This wrapper is invoked by managed code over the
PInvoke. The assembly, invoking the wrapper, has "Platform target" set
to "Any CPU" and I have no problems with linking it to another
assemblies. But actually I assume there is much easier method.
I work with native code over the PInvoke. The problem is when I link
the 32bit native library I have to switch "Platform target" to x86 to
avoid the BadImageFormatException. At this point my assembly becomes
32bit (=x86) and all assemblies referencing this assembly should also
be 32bit (=x86), otherwise I get BadImageFormatException.
Is it possible in some way to leave the assembly in the x64 world but
link 32bit dll using PInvoke?
I have an idea, but I do not like it. I have created the wrapping
native library on C++ that links another library explicitly in runtime
by LoadLibrary(...). This wrapper is invoked by managed code over the
PInvoke. The assembly, invoking the wrapper, has "Platform target" set
to "Any CPU" and I have no problems with linking it to another
assemblies. But actually I assume there is much easier method.