我正在尝试部署到运行AppFabric的Windows 2008 R2 64位服务器,该服务连接到Oracle 10gR2数据库。在我的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设置很难?我试图解决什么问题?有谁知道一篇博文会展示如何正确设置它?我试着看,但是找不到任何东西,我确信我不是唯一有这个问题的人 好吧,任何帮助都会非常感激。 Tks这么多
修改
我正在尝试使用ODP.NET,因为尝试使用Microsoft的OracleClient时出现了所有问题。我在我的开发机器上安装了OPD.NET2 64位,在项目的Reference上,我删除了32位引用,并手动引用了64位的Oracle.DataAccess.dll。每当我这样做时,我都无法在Dev Machine上使用该解决方案,因为我收到错误:
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 ---
答案 0 :(得分:8)
我删除了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
我的开发机器上遇到了同样的问题。我在IIS上检查了应用程序池的设置,结果发现“启用32位应用程序”选项已设置为“True”。我只在64位应用程序上工作,所以我可以安全地将此选项设置为其默认值:“False”。之后一切正常。
您可以在IIS 7管理器中更改此设置。右键单击应用程序池,然后选择“高级设置...”。它在“(一般)”组中。
答案 1 :(得分:3)
好的,我能够使用Oracle ODP.Net开展工作。只需采取以下步骤:
install.bat all c:\oracle\64 oracle_home
为避免TNS问题,由于不会安装完整的客户端,请使用连接字符串:
数据源=(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP)(HOST = SERVERHOSTNAME)(PORT = 1521))(CONNECT_DATA =(SERVICE_NAME = ORCLSID)));用户ID =用户;密码= blablabla;
像往常一样在IIS / AppFabric上安装部署包。
Tks @ rlee923求助!
答案 2 :(得分:2)
你下载并安装了64位版本的客户端吗?
似乎dataaccess oracle dll文件是32位。
如果你还没有我不确定使用R2安装64位版本的客户端是否仍有问题,但你可能需要修改安装程序的xml文件才能工作。