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或其依赖项之一.试图加载格式不正确的程序)
问题描述
我在 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"或其依赖项之一.试图加载格式不正确的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法加载文件或程序集“Oracle.DataAccess"或其依赖项之一.试图加载格式不正确的程序
基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01