“An attempt was made to load a program with an incorrect format” even when the platforms are the same

前端 未结 20 2607
悲&欢浪女
悲&欢浪女 2020-11-22 13:57

I\'m calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is:

BadImageFormatException: An attempt was made to load a program w

20条回答
  •  囚心锁ツ
    2020-11-22 14:24

    In my case, I am using a tiny .exe that reloads the referenced DLLs via Reflection. So I just do these steps which saves my day:

    From project properties on solution explorer, at build tab, I choose target platfrom x86

提交回复
热议问题