使用 oracle.dataaccess.dll 时出错 [英] Error using oracle.dataaccess.dll

查看:71
本文介绍了使用 oracle.dataaccess.dll 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Web 应用程序,它使用 Oracle.DataAccess.dll 与 Oracle 数据库通信.部署在 32 位 windows 系统上的 web 应用程序可以工作,但不能在 windows server 2008 64 位上运行.我安装了 10204_vista_win2k8_x64_production_db 包,从项目中引用了已安装的 dll(版本 2.102.4.0),但出现以下错误:

I have a web application which uses Oracle.DataAccess.dll to communicate with an Oracle db. The web application deployed on 32 bit windows system works but not on windows server 2008 64 bit. I installed 10204_vista_win2k8_x64_production_db package, referenced the installed dll (version 2.102.4.0) from the project but I get the following error:

无法加载文件或程序集Oracle.DataAccess, Version=2.102.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342"或其依赖项之一.系统找不到指定的文件.

Could not load file or assembly 'Oracle.DataAccess, Version=2.102.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

推荐答案

这里也一样.Oracle.DataAccess 程序集不在 64 位模式下运行.

Same here. The Oracle.DataAccess assembly doesn't run in 64 bit mode.

您应该将您网站的应用程序池设置为 32 位模式(转到应用程序池的高级设置并将允许 32 位应用程序设置为真")

You should set the application pool for your site to 32 bit mode (go to the application pool's Advanced Settings and set Allow 32 Bit Applications to "True")

如果这不起作用,请确保您的 Oracle 目录(包含所有 Oracle dll 的目录)在您的系统路径中.如果你忘记了这一点,你会得到同样的关于找不到 Oracle.DataAccess 的神秘错误.

If that doesn't work, make sure your Oracle directory (the directory containing all the Oracle dlls) is in your system path. If you forget that, you get the same cryptic error about not finding Oracle.DataAccess.

编辑:

安装 Oracle 客户端可能是一个大难题.使用 Oracle Instant Client 比使用安装完整的客户端,所以这是我通常做的:

Installing the Oracle client can be a major pain. Using the Oracle Instant Client is somewhat easier than installing the full client, so this is what I usually do:

  1. 下载 Oracle Instant Client
  2. 将存档解压缩到 c:oracle(任何其他目录都可以)
  3. 打开命令提示符以管理员身份
  4. 输入 cd oracle
  5. 输入配置odp.net20 myhome
  6. 右键单击我的电脑"、高级系统设置"、环境变量",然后将 C:oracle 目录添加到系统路径
  7. 将 Oracle.DataAccess.dll 文件从 c:oracleodp.netin2.x 复制到应用程序的 bin 文件夹
  8. (可选)编辑您的 c:oracle nsnames.ora 文件

这篇关于使用 oracle.dataaccess.dll 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆