在服务器上安装ODP.net以解决Oracle.DataAccess.Client.OracleException:提供程序与Oracle客户端版本不兼容

发布于 2024-12-18 14:51:41 字数 546 浏览 1 评论 0原文

我有一个我的站点将使用的服务的测试环境和一个生产环境。在我的测试环境中,我在服务器上安装了 ODP.net。到目前为止,使用 Oracle 的服务似乎运行得相当顺利。我似乎根本没有在该服务器上运行 Oracle 客户端。另一方面,我有一台服务器,上面有一个 Oracle 客户端,但似乎没有安装 ODP.net (我正在仔细检查,但这就是这个 SO 问题的情况) 。在生产服务器上,我遇到了这个异常:

Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client

在两台服务器中,我的 bin 和 lib 文件夹中都有 Oracle.DataAccess dll(我认为我不需要在 lib 文件夹中使用它,但为什么要破坏这一切......我相信你可以想出一个很好的理由,但不是现在!!!)。我的问题是我需要在生产服务器上安装 ODP.net 吗?这解决了您遇到的任何问题吗?我看过一些 SO 帖子,说这为他们解决了类似的问题。您能推荐一个行动方案吗?谢谢你!

I have a test environment for a service that my site will be using and a production environment. In my test environment I have ODP.net installed on the server. That service that uses Oracle seems to be running pretty smoothely so far. I don't appear to have an Oracle Client running on that server at all. On the other hand I have a server which has an Oracle client on it, but doesn't appear to have ODP.net installed on it (I am in the process of double checking, but that is the situation as of this S-O question). On the production server I get this exception:

Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client

in both servers I have the Oracle.DataAccess dll in the bin and lib folders (don't think I need it in the lib folder, but why rock the boat... I am sure you can come up with a good reason, but not right now!!!). My question is do I need to install ODP.net onto the production server? Has that resolved any issues that you have come across? I have seen some SO post that say this resolved a similar issue for them. Could you recommend a course of action? Thank you!

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

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

发布评论

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

评论(5

蓝海似她心 2024-12-25 14:51:42

我在 Windows 2012 Server 中遇到了同样的问题,我安装了 Oracle 10.2.0.3(假定的 oracle 10.2 版本与 64 位兼容)并部署了一个使用 10.2.0.1 Oracle 客户端的网站。

我尝试了这篇文章中的所有解决方案,但最有效的是 Abdallah 回答的最后一点:

“在 IIS 中为应用程序池启用 32 位”

当然,我还必须使用正确的 Oracle.Data.Access 参考 (10.2.0.3)

最后,错误消息让我感到困惑,因为它让我盲目地解决版本问题,但真正的问题是 IIS 无法执行 32 位应用程序。

希望有帮助

I run with the same problem in a Windows 2012 Server that i had Installed Oracle 10.2.0.3 (the supossed oracle 10.2 version compatible with 64 bits) and deployed a web site that used 10.2.0.1 Oracle client.

I tried all solutions in this post but the one that worked form my was the last point of Abdallah answer:

"Enable 32bit for the App Pool in IIS"

Of course I also had to deploy my webapp with the correct Oracle.Data.Access reference (10.2.0.3)

Finally the error message was confusing me because it drived me to be blinded to resolve the version issue, but the really problem was IIS not being capable to excute 32 bits App.

Hope it helps

萌梦深 2024-12-25 14:51:42

谢谢...这帮助我节省了将 ASP.Net 应用程序从 32 位转换为 64 位的时间...

详细信息:
APP服务器寻找客户端库,即使我们使用远程组件连接到ORACLE db...使用ORACLE客户端64位..

将这5个dll复制到我的app/bin文件夹

  1. oci.dll
  2. oraociicu11.dll
  3. oraops11w 后,我得到的异常得到了解决.dll
  4. orannzsbb11.dll
  5. ociw32.dll

错误消息:
“Oracle.DataAccess.Types.OracleString”的类型初始值设定项引发异常。

错误详细信息:
System.TypeInitializationException:“Oracle.DataAccess.Types.OracleString”的类型初始值设定项引发异常。 ---> Oracle.DataAccess.Client.OracleException 提供程序与 Oracle.DataAccess.Client.OracleInit.Initialize() 处的 Oracle 客户端版本不兼容
--- 内部异常堆栈跟踪结束 ---

服务器堆栈跟踪:
在 System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType 类型)
在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseMember(ParseRecord pr)
在 System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录)
在 System.Runtime.Serialization.Formatters.Binary.
_BinaryParser.Run()
在System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler处理程序,__BinaryParser serParser,布尔fCheck,布尔isCrossAppDomain,IMethodCallMessage methodCallMessage)
在System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流serializationStream,HeaderHandler处理程序,布尔fCheck,布尔isCrossAppDomain,IMethodCallMessage methodCallMessage)
在System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流serializationStream,HeaderHandler处理程序,布尔fCheck,IMethodCallMessage methodCallMessage)
在 System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

在 [0] 处重新抛出异常:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 类型)

Thanks... this helped me saved time on converting frm 32 bit to 64 bit of our ASP.Net Application...

In Details:
APP server looking for client libraries, even we use remoting component to connect to ORACLE db... with ORACLE client 64 bit..

Execption I got was resolved after copying these 5 dll's into my app/bin folder

  1. oci.dll
  2. oraociicu11.dll
  3. oraops11w.dll
  4. orannzsbb11.dll
  5. ociw32.dll

Error Message:
The type initializer for 'Oracle.DataAccess.Types.OracleString' threw an exception.

Error Details:
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Types.OracleString' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle client at Oracle.DataAccess.Client.OracleInit.Initialize()
--- End of inner exception stack trace ---

Server stack trace:
at System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType type)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseMember(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.
_BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

罪歌 2024-12-25 14:51:41

Oracle 客户端有很多小子版本,可能发生的情况是,出现错误的计算机上安装的 Oracle 客户端与 Oracle.DataAccess.dll 的版本不完全相同文件来自.

最好的办法是确保在每台开发计算机和服务器上使用完全相同相同的安装包。这将避免任何不匹配。

作为替代方案,我过去为解决此问题所做的事情(这可能不是“最好”的事情,但它通常对我有用)是复制文件 < code>OraOps11.dll 以及 Oracle.DataAccess.dll 文件复制到您的 \bin 目录。

从安装有 Oracle.DataAccess.dll 的同一台计算机上的同一 Oracle 安装中获取该文件。它应该位于类似以下名称的文件夹中,具体取决于您安装 Oracle 的位置以及版本:

C:\oracle\product\11.1.0\client_1\bin\OraOps11.dll

There are a lot of little sub versions of the oracle client, and what likely happened is that the oracle clients installed on the machine giving the error isn't exactly the same version that the Oracle.DataAccess.dll file came from.

The best thing to do is make sure you use exactly the same install package on every dev machine and server. This will avoid any missmatch.

As an alternative, what I've done in the past to resolve this (and it may not be the "best" thing to do, but it usually works for me) is to also copy the file OraOps11.dll to your \bin directory, along with the Oracle.DataAccess.dll file.

Get the file from the same oracle install on the same machine where you got Oracle.DataAccess.dll. It should be in a folder named something like this, depending on where you installed Oracle, and what version:

C:\oracle\product\11.1.0\client_1\bin\OraOps11.dll

看春风乍起 2024-12-25 14:51:41

一旦我运行它们,这对我有用:

OraProvCfg /action:config /product:odp /frameworkversion:v2.0.50727 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll

OraProvCfg /action:config /product:odp /frameworkversion:v4.0.30319 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\4\Oracle.DataAccess.dll

祝你好运

This worked for me once i ran them:

OraProvCfg /action:config /product:odp /frameworkversion:v2.0.50727 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll

OraProvCfg /action:config /product:odp /frameworkversion:v4.0.30319 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\4\Oracle.DataAccess.dll

Good luck

筑梦 2024-12-25 14:51:41

我遇到了完全相同的问题,我尝试复制尽可能多的 dll,但没有任何运气。

最后我不得不在服务器(Win 2008 R2 64位)中安装“ODTwithODAC121012”(32位)。

安装后,请确保:

  • PATH 已更新为 Oracle dll 位置:\product\12.1.0\client_1\bin 和 \product\12.1.0\client_1
  • 重新启动服务器。
  • 在 IIS 中为应用程序池启用 32 位。

I faced exactly the same problem, I tried to copy as much dlls as I can but without any luck.

At the end I had to install "ODTwithODAC121012"(32bit) in the server(Win 2008 R2 64bit).

After installation make sure:

  • PATH is updated with Oracle dlls location: \product\12.1.0\client_1\bin and \product\12.1.0\client_1
  • Restart the server.
  • Enable 32bit for the App Pool in IIS.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文