试图加载格式不正确的程序

部署IIS的时候,会出现

System.BadImageFormatException: Could not load file or assembly 'xxx' or one of its dependencies. 试图加载格式不正确的程序。

问题分析:

由于编译中有的是32位有的是64位  不一致

解决办法:

1.找到IIS该站点对应的应用程序池

2.右键菜单  -->高级设置

3.常规-->启用32位应用程序  将False 更改为True  就行了

原文地址:https://www.cnblogs.com/jingch/p/4478792.html