views:

215

answers:

1

By default, my application references a mixed mode DLL, so this DLL is both 32 and 64 bit. On a 32 bit system, my app is MSIL and loads the 32 bit DLL. On a 64 bit system, my app loads the 64 bit.

However on a 64 bit system, in an older version of the assembly that I am referencing, they only created a 32 bit version. So I fail to load this. I was looking at doing it dynamically, and ideally I would want my MSIL app in 64 bit mode to load the 32 bit DLL. Is this possible?

Also it would be nice to resolve it to a different version than what I have referenced as well.

Any help appreciated.

+1  A: 

You cannot load 32-bit DLLs into 64-bit processes. "Any CPU" assemblies work because the JIT handles the IL compilation before execution, creating a native image of the appropriate type; CPU-specific assemblies don't support JITing to different types.

This is a Windows limitation, not a CLR limitation.

Dan Story