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

前端 未结 20 2989
悲&欢浪女
悲&欢浪女 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:34

    If you are using Any CPU, you might encounter this issue if the Prefer 32-bit option is checked:

    Make sure you uncheck this option in the project's property's Build tab!

提交回复
热议问题