无法加载文件或程序集“Oracle.DataAccess"或其依赖项之一.试图加载格式不正确的程序

Could not load file or assembly #39;Oracle.DataAccess#39; or one of its dependencies. An attempt was made to load a program with an incorrect format(无法加载文件或程序集“Oracle.DataAccess或其依赖项之一.试图加载格式不正确的程序)
本文介绍了无法加载文件或程序集“Oracle.DataAccess"或其依赖项之一.试图加载格式不正确的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 IIS 7.0 Windows Server 2008 R2 64bit 上安装了一个 Web 应用程序.我指的是 oracle.DataAccess.dll;当我尝试访问应用程序时,我收到以下消息:无法加载文件或程序集‘Oracle.DataAccess’或其依赖项之一.试图加载格式不正确的程序."有人可以帮帮我吗?

I have installed a Web app on IIS 7.0 Windows Server 2008 R2 64bit. I am referring an oracle.DataAccess.dll; When I try to access the application I get the following message: "Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format." Can anybody help me, please?

推荐答案

使用11.2 Release 3 (11.2.0.2.1) with Xcopy Deployment"版本的Oracle Data Access Component安装过程好像坏了.要解决此问题,您必须在 GAC 中注册缺少的程序集.要为这个特定版本执行此操作,请从管理员控制台中运行以下命令:

It seems the Oracle Data Access Component installation process using the "11.2 Release 3 (11.2.0.2.1) with Xcopy Deployment" version is broken. To fix this you must register the missing assemblies in the GAC. To do this for this specific version run these commands from within an administrator console:

md C:WindowsassemblyGAC_32Oracle.DataAccess4.112.2.0__89b483f429c47342

copy %ORACLE_HOME%odp.netin4Oracle.DataAccess.dll C:WindowsassemblyGAC_32Oracle.DataAccess4.112.2.0__89b483f429c47342

md C:WindowsassemblyGAC_32Oracle.Web4.112.2.0__89b483f429c47342

copy %ORACLE_HOME%asp.netin4oracle.web.dll C:WindowsassemblyGAC_32Oracle.Web4.112.2.0__89b483f429c47342

请注意,这仅注册 DLL 的而不是其他语言资源.因此,如果您使用除英语以外的任何其他语言(de、es、fr、it、ja、ko、pt-BR、zh-CHS 和 zh-CHT),那么您还需要使用相应的资源注册这些语言文件.

Note that this registers only the DLL's but not other languages resources. So, if you are using any another language than English (de, es, fr, it, ja, ko, pt-BR, zh-CHS, and zh-CHT), then you need to register these as well using the corresponding resource file.

如果您在机器上安装了 Visual Studio,则可以发出以下命令:

If you have Visual Studio installed on the machine, you can issue the following commands instead:

gacutil /i %ORACLE_HOME%odp.netin4Oracle.DataAccess.dll
gacutil /i %ORACLE_HOME%asp.netin4oracle.web.dll

注意:在 Visual Studio 安装文件夹下查找 gacutil.exe.

Note: look for gacutil.exe under the Visual Studio installation folder for it.

希望这会有所帮助.

附:或者你可以试试 这个.

P.S. Or you can try this.

这篇关于无法加载文件或程序集“Oracle.DataAccess"或其依赖项之一.试图加载格式不正确的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Batch multiple select statements when calling Oracle from ADO.NET(从 ADO.NET 调用 Oracle 时批处理多个选择语句)
How to get the generated id from an inserted row using ExecuteScalar?(如何使用 ExecuteScalar 从插入的行中获取生成的 id?)
Binding query parameters by name with ODP.NET(使用 ODP.NET 按名称绑定查询参数)
Why the semicolon couldn#39;t place in the CommandText of a OracleCommand when C#(为什么在 C# 时分号不能放在 OracleCommand 的 CommandText 中)
DbCommand and parameterized SQL, ORACLE vs SQL Server(DbCommand 和参数化 SQL、ORACLE 与 SQL Server)
Oracle Stored Procedure and custom data type(Oracle 存储过程和自定义数据类型)