【发布时间】:2011-08-19 07:23:48
【问题描述】:
我正在尝试将连接到 Oracle 10gR2 数据库的 WCF 4.0 服务部署到运行 AppFabric 的 Windows 2008 R2 64 位服务器。在我的 Windows 7 64 位系统上,在 Visual Studio 2010 中,一切顺利。 我首先开始使用 Oracle ODP.NET,在部署时,我开始获得:
System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
File name: 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'
我尝试了很多东西,但似乎没有任何效果,因为我很想让这个工作,所以去了 OracleClient,尽管它被标记为已弃用,只是为了让它工作,然后买我时间。我删除了我已安装的所有内容,但只安装了带有运行时选项的 win64_11gR2_client.zip。但是,比我开始得到的:
System.DllNotFoundException: Unable to load DLL 'oramts.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
所以我重新安装了 win64_11gR2_client.zip,添加了 Oracle Services for Microsoft Transaction Server 组件。但是,每当我调用我的 WCF 服务时,IIS 都会崩溃并出现以下错误:
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7c8f9
Exception code: 0xc0000374
Fault offset: 0x00000000000c40f2
Faulting process id: 0xb28
Faulting application start time: 0x01cc0b141a857fac
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 7630c4b0-7707-11e0-8419-00155d010609
如果我尝试更改 AppPool 以启用 32 位应用程序,WSDL 甚至不会生成,我会得到:
A process serving application pool 'MyAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '2856'. The data field contains the error number.
我迷路了,我不知道该怎么办。做一个“简单”和典型的 Oracle 设置怎么会这么难?我会尝试解决什么问题?有谁知道博客文章会显示如何正确设置它?我试着寻找,但找不到任何东西,而且我确定我不是唯一遇到此问题的人
好吧,任何帮助将不胜感激。太感谢了
编辑
我回来尝试使用 ODP.NET,因为尝试使用 Microsoft 的 OracleClient 时出现的所有问题。我在我的开发机器上安装了 OPD.NET2 64 位,在项目的参考上,我删除了 32 位参考,并手动参考了 64 位 Oracle.DataAccess.dll。每当我这样做时,我都无法在我的开发机器上使用该解决方案,因为我收到错误:
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: 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
这可能是因为它尝试加载 32 位 ODAC,而不是 64 位 ODAC。但是,在我部署到我的 64 位服务器后,我停止收到 FileNotFoundException,但我开始收到:
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
【问题讨论】:
标签: wcf oracle iis-7 64-bit windows-server-2008