IIS 加载32dll失败

前言

遇到一个这样的问题,因为在一个项目中是32位的,至于为什么是32位的呢,因为调用的都是老库,32位的,部署到iis出现错误如下:

Server Error in '/' Application.

试图加载格式不正确的程序。 (Exception from HRESULT: 0x8007000B)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: 试图加载格式不正确的程序。 (Exception from HRESULT: 0x8007000B)

解决方案

原因:开发环境和部署环境不同造成的(系统64bit 和 系统32bit)
解决方法:IIS》应用程序池》选中所用的程序池名称右击》高级设置》常规》启用32位应用程序,改为True。

原文地址:https://www.cnblogs.com/aoximin/p/13121847.html