asp.net-mvc 无法加载文件或程序集 Oracle.DataAccess
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8661749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not load file or assembly Oracle.DataAccess
提问by user975260
I have an asp.net mvc (EF) project , I had downloaded oracle data provider with version 4.112.2.50 -32bit on my pc when moving project to windows server 2008 (I have the same version of odp-64bit) I have the below problem:
我有一个 asp.net mvc (EF) 项目,当将项目移动到 windows server 2008 时,我在我的电脑上下载了版本为 4.112.2.50 -32bit 的 oracle 数据提供程序(我有相同版本的 odp-64bit)我有以下内容问题:
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.
无法加载文件或程序集“Oracle.DataAccess”或其依赖项之一。试图加载格式不正确的程序。
when I toke Oracle the "Oracle.DataAccess.dll" from the server and make it with my project reference I have another error message like the above with a file "Oracle.Web"
当我从服务器获取 Oracle 的“Oracle.DataAccess.dll”并使用我的项目引用创建它时,我有另一个错误消息,如上述文件“Oracle.Web”
Could not load file or assembly 'Oracle.Web' or one of its dependencies. An attempt was made to load a program with an incorrect format.
无法加载文件或程序集“Oracle.Web”或其依赖项之一。试图加载格式不正确的程序。
also if I get the File "Oracle.Web.dll" to my project reference from the server I have the same error with "Oracle.Web"
此外,如果我从服务器获取文件“Oracle.Web.dll”到我的项目引用,我也会遇到与“Oracle.Web”相同的错误
回答by McHaroni
In the IIS Managerselect your server and select "Application Pools". Select the application pool used by your Web App and click on "Advanced Settings" from the right hand menu.
在IIS 管理器中选择您的服务器并选择“应用程序池”。选择您的 Web 应用程序使用的应用程序池,然后从右侧菜单中单击“高级设置”。
In the "General Section" of the advanced Settings click on the "Enable 32-bit Applications" and set it to True.
在高级设置的“常规部分”中,单击“启用 32 位应用程序”并将其设置为True。
This fix only applies to 64-bit servers that attempt to execute the 32-bit version of the Oracle Dlls.
此修复仅适用于尝试执行 32 位版本的 Oracle Dll 的 64 位服务器。
Regards George
问候乔治
回答by Jacob
George Wrote:
乔治写道:
In the IIS Manager select your server and select "Application Pools". Select the application pool used by your Web App and click on "Advanced Settings" from the right hand menu.
In the "General Section" of the advanced Settings click on the "Enable 32-bit Applications" and set it to True.
This fix only applies to 64-bit servers that attempt to execute the 32-bit version of the Oracle Dlls.
在 IIS 管理器中选择您的服务器并选择“应用程序池”。选择您的 Web 应用程序使用的应用程序池,然后从右侧菜单中单击“高级设置”。
在高级设置的“常规部分”中,单击“启用 32 位应用程序”并将其设置为 True。
此修复仅适用于尝试执行 32 位版本的 Oracle Dll 的 64 位服务器。
The opposite is also true. If you are using the 64 bit versionof the Oracle Dlls then you must set "Enable 32-bit Applications" to false.
反之亦然。如果您使用的是 64 位版本的 Oracle Dll,则必须将“启用 32 位应用程序”设置为false。
--Jacob
--雅各布
回答by gdoron is supporting Monica
- Oracle.DataAccess.dll must be installed not only referenced.
- Change the copy local property of the reference to true.
- Oracle.DataAccess.dll 必须安装,不能只引用。
- 将引用的复制本地属性更改为 true。
回答by tsells
Incorrect Format indicates a bitness problem. To get the server running change the application pool your program is running in to enable 32 bit support or install a 64 bit oracle client.
不正确的格式表示位问题。要使服务器运行,请更改运行程序的应用程序池,以启用 32 位支持或安装 64 位 oracle 客户端。
回答by ward coysman
Changing app pool from 64-bit to 32-bit is a solution.
将应用程序池从 64 位更改为 32 位是一种解决方案。
回答by Elvin Mammadov
Deleting binand objfolders solved my problem.
删除bin和obj文件夹解决了我的问题。

