Loading a 32-bit dll in a 64-bit process [duplicate]
问题 This question already has answers here : Target 32 Bit or 64 Bit native DLL depending on environment (3 answers) DllImport - An attempt was made to load a program with an incorrect format [duplicate] (1 answer) Closed 5 years ago . I want my C# application to conditionally run a native method, conditionally choosing to run either the x86 or the x64 version of the dll. Whenever I try to load the 32 bit dll I get the below error: Unhandled Exception: System.BadImageFormatException: An attempt