打开服务器上网站是出现如下错误:
试图加载格式不正确的程序。 (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)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[BadImageFormatException: 试图加载格式不正确的程序。 (Exception from HRESULT: 0x8007000B)] System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset) +0 System.Data.OracleClient.OCI.DetermineClientVersion() +297 [InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.] ZFSoft.BusinessEntity.LoadFromSql(String sp, ListDictionary Parameters, CommandType commandType) +1659 ZFSoft.BusinessEntity.LoadFromSql(String sp, ListDictionary Parameters) +72 ZFSoft.DAL._SYS_USER.LoadByPrimaryKey(String ACCOUNT) in E:.....\ZFSoft.DAL\SYS_USER.cs:105 Manage_Login.UserLogin(String _Account, String _Password) +164 Manage_Login.btnLogin_Click(Object sender, EventArgs e) +270 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691 |
试图加载格式不正确的程序(从HRESULT异常:0x8007000B)
描述:在当前Web请求的执行过程中发生未处理的异常。请检查堆栈跟踪有关该错误的详细信息以及它起源于代码。
异常详细信息:System.BadImageFormatException:试图加载格式不正确的程序(从HRESULT异常:0x8007000B)
源错误:
当前Web请求的执行过程中生成了未处理的异常。有关异常的来源和位置信息可以使用下面的异常堆栈跟踪信息确定。
堆栈跟踪:
[BadImageFormatException:试图加载格式不正确的程序(从HRESULT异常:0x8007000B)
System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr的svchp,IntPtr的errhp,IntPtr的dst_locp,IntPtr的src_locp,UINT64量,UINT64 DST_OFFSET,UINT64 src_offset)+ 0
System.Data.OracleClient.OCI.DetermineClientVersion()+297
[InvalidOperationException异常:尝试加载Oracle客户端库扔BadImageFormatException。在64位模式下安装了32位的Oracle客户端组件运行时,会出现此问题。]
ZFSoft.BusinessEntity.LoadFromSql(字符串SP,ListDictionary参数,命令类型的CommandType)1659
ZFSoft.BusinessEntity.LoadFromSql(字符串SP,ListDictionary参数)+72
ZFSoft.DAL._SYS_USER.LoadByPrimaryKey(字符串ACCOUNT)在E:.......\ ZFSoft.DAL \ SYS_USER.cs:105
Manage_Login.UserLogin(字符串_Account,字符串_Password)+164
Manage_Login.btnLogin_Click(对象发件人,EventArgs的)+270
System.Web.UI.WebControls.Button.RaisePostBackEvent(字符串eventArgument)+154
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)3691
问题说明:
之前装了32位的Navicat,卸载了问题还是存在,但是另一台服务器上也装了32位的Navicat就没有问题,仔细对比下配置,发现标红部分不一样:
这里把应用程序池的启用32位应用程序的False改成True就行了,然后重新启动下IIS。