从文件共享使用 ODP.NET 的 WebService

发布于 2024-09-15 01:45:24 字数 769 浏览 1 评论 0原文

我有一个 C# ASMX Web 服务,它使用 Oracle.DataAccess.Client 连接到 Oracle 数据库。当我尝试调用 Web 方法时,收到以下错误消息:

无法加载 dll“OraOps10.dll”

之前问过,显着的区别是我确实有 ODAP(至少我在 Oracle 客户端安装的 bin 目录中有 OraOps10.dll),但它已安装 >在文件共享 (W:) 上,并且未在我的计算机上注册(Web 服务在 VisualStudio 的测试 Web 服务器上运行)。

即使我尝试将上述 DLL 复制到 Web 服务 bin/ 目录中,它也找不到它。堆栈跟踪听起来像是在注册表中寻找它。

有什么方法可以告诉我的 Web 服务在哪里可以找到 ODAP 安装吗?(在 web.config 或类似文件中设置 ORACLE_HOME)

请注意:可以使用有效的 Oracle 客户端安装在每台目标计算机上,打开与 System.Data.Oracle 的 Oracle 连接都可以正常工作,只是客户端安装似乎不包含 ODAP:我在“添加引用 -> ”中找不到任何“Oracle”条目。 。网”。*)

I have a C# ASMX web service that uses Oracle.DataAccess.Client to connect to an Oracle database. When I try to call a web method I get this error message:

unable to load dll 'OraOps10.dll'

It's the same problem as asked before, with the significant difference that I do have ODAP (at least I have OraOps10.dll in an Oracle client installation's bin directory), but it is installed on a File Share (W:), and not registered on my machine (where the web service runs on VisualStudio's test web server).

Even when I tried and copied the said DLL into the web service bin/ directory, it wouldn't find it. The stacktrace sounds like it is looking for it in the registry.

Is there any way I can tell my web service where to find the ODAP installation? (Set the ORACLE_HOME in the web.config or similar)

(Please note: A working Oracle client installation is available on every target machine and it works fine to open an Oracle connection with System.Data.Oracle, only that client installation seems not to include the ODAP: I cannot find any "Oracle" entry in "Add Reference -> .NET".*)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏花。依旧 2024-09-22 01:45:24

如果我没看错的话,听起来您在本地安装了 Oracle 客户端,但没有在本地安装 ODP.net 客户端 - 相反,它“安装”在另一台计算机上,但它使用它的 ORA home 作为共享“W:”驱动器。

您知道 W: 驱动器上的 ODP 安装是什么类型吗?

如果是 XCOPY(但您也可以安全地尝试经典安装),只需添加 PATH 变量即可安全:(一如既往,在使用 PATH 或注册表备份之前!)
http://www.oracle.com/technetwork/ oramag/2008/08-nov/o68odpnet-101744.html

第 8 步:
安装Oracle的最后一步
数据访问组件和 Oracle
数据库即时客户端
开发机是添加两项
到 Path 环境变量。
右键单击我的电脑图标,然后
从上下文中选择属性
菜单。接下来,单击高级选项卡
系统属性对话框和
然后点击环境变量
按钮。在系统变量组中,
在列表中找到 Path 变量
(如有必要,向下滚动)。单击
列表中的路径变量,然后
单击编辑。在编辑系统中
变量对话框,将光标置于
在条目的开头和
类型
C:\oracle\11.1\odac;C:\oracle\11.1\odac\bin;
。单击“确定”关闭编辑系统
变量对话框,点击确定关闭
环境变量对话框,
最后再次点击确定关闭
系统属性对话框

至于注册表;查看

HLM\软件\ORACLE\ODP.NET

让它正常工作的一个可靠方法是将 ODP 本地安装到测试盒上,但 PATH 变量应该是您所需要的。您可以找到文件@
http://www.oracle.com/technetwork/topics/dotnet/ Whatsnew/index.html

If I am reading this correctly, it sounds like you have the Oracle Client installed locally but not the ODP.net client installed locally -- rather it is 'installed' on a different computer but it uses it's ORA home as the shared 'W:' drive.

Do you know what type of ODP installation is on the W: drive?

if it is XCOPY (but you may also be safe to try this out with a classic install) you may be safe with simply adding the PATH variables: (as always, before monkeying around with the PATH or the registry BACK IT UP!)
http://www.oracle.com/technetwork/oramag/2008/08-nov/o68odpnet-101744.html

Step 8:
The last step in installing Oracle
Data Access Components and Oracle
Database Instant Client on the
developer machine is to add two items
to the Path environment variable.
Right-click the My Computer icon and
select Properties from the context
menu. Next, click the Advanced tab in
the System Properties dialog box and
then click the Environment Variables
button. In the System variables group,
locate the Path variable in the list
(scroll down if necessary). Click the
Path variable in the list and then
click Edit. In the Edit System
Variable dialog box, place the cursor
at the beginning of the entries and
type
C:\oracle\11.1\odac;C:\oracle\11.1\odac\bin;
. Click OK to close the Edit System
Variable dialog box, click OK to close
the Environment Variables dialog box,
and finally click OK again to close
the System Properties dialog box

As for the registry; check

HLM\SOFTWARE\ORACLE\ODP.NET

A sure fire way to get it to work is to install ODP locally onto the test box, but the PATH variables should be all that you need. You can find the files @
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文