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

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

    If you try to run 32-bit applications on IIS 7 (and/or 64-bit OS machine), you will get the same error. So, from the IIS 7, right click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".

    Restart your website and it should work.

    enter image description here

提交回复
热议问题