Oracle.DataAccess错误 [英] Oracle.DataAccess Error

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

问题描述

我在Windows环境下运行的asp.net / C#的Web应用程序。
该项目建立精细和完美的运行我的本地机器的VB.net开发服务器上。

I have an asp.net / C# web application running in a Windows environment. The project builds fine and runs perfectly on my local machine's VB.net development server.

然而,当我发布到我收到以下错误消息,真正的应用服务器:

However, when I publish to the real application server I receive the following error message:

[OracleException(0X80004005):该供应商是不是与Oracle客户端的版本兼容]
[TypeInitializationException:为Oracle.DataAccess.Client.OracleConnection'的类型初始值引发了异常]

[OracleException (0x80004005): The provider is not compatible with the version of Oracle client] [TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.]

有就是这个应用程序的当前版本运行起来就好了,我在不同的目录现场服务器上测试。我甚至尝试从工作应用程序的.dll抽丝的Oracle.DataAccess但仍得到相同的错误消息。

There is a version of this application currently up and running just fine, I am testing on the live server in a different directory. I even tried snagging the Oracle.DataAccess .dll from the working application but still get the same error message.

推荐答案

第一关:Oracle客户端/服务提供者是一个烂摊子。和无二既在MS酮(德$ P $无论如何pciated)以及在Oracle之一。

First off: The Oracle client/provider is a mess. And that goes for both the MS one (depreciated anyway) as well as the Oracle one.

为了通过ODP.NET提供三件事情需要注册后才能连接到Oracle数据库的设置正确:

In order to connect to an Oracle DB via the ODP.NET provider three things need to be setup properly:


  • Oracle客户端需要设置正确(无关与.NET提供程序,这指的是安装oracle的客户端一般在C:\\ ORACLE)

  • 的ODP.NET供应商需要与已安装的Oracle客户端兼容

  • 客户端和供应商的架构和应用程序需要匹配,你不能在x86提供商/应用,反之亦然
  • 使用64位客户端
  • Oracle client needs to be setup properly ( has nothing to do with the .NET provider, this referring to the installed oracle client usually in c:\oracle)
  • The ODP.NET provider needs to be compatible with the installed Oracle client
  • The architecture of client and provider and your application need to match, you cannot use the 64bit client with an x86 provider/application and vise versa

通常情况下,最好是同时拥有最新版本。但是,如果你想获得一次摆脱这个问题,并为所有使用第三方的Oracle .NET提供。

Usually the best is to have the newest version of both. But if you want to get rid of this issue once and for all use a third party oracle .NET provider.

更新

在一个更好的是从DataDirect的(无隶属关系):结果
<一href=\"http://www.datadirect.com/products/net/net-for-oracle/index.html\">http://www.datadirect.com/products/net/net-for-oracle/index.html

One of the better ones is from DataDirect (no affiliation):
http://www.datadirect.com/products/net/net-for-oracle/index.html

这不只是安装(无需oracle的客户端),但它也快,完全托管,x64和普遍支持是一种比你的ODP.NET一送什么好。这虽然会花费你。

It's not just installation (no oracle client necessary), but it's also faster, fully managed, x64 and general support is a way better than what you get with the ODP.NET one. It will cost you though.

该DevArt一个是pretty体面以及(更加便宜得多):结果
http://www.devart.com/dotconnect/oracle/

The DevArt one is pretty decent as well (and much much cheaper):
http://www.devart.com/dotconnect/oracle/

我们决定为DataDirect的可扩展性的原因,这不应该是相关的,你不过。

We decided for the DataDirect for extensibility reasons, this should not be relevant to you however.

在这里您可以找到构建.NET提供者,不限于甲骨文虽然第三方编好:结果
<一href=\"http://msdn.microsoft.com/en-us/data/dd363565\">http://msdn.microsoft.com/en-us/data/dd363565

Here you can find a good compilation of third parties that build .NET providers, not limited to oracle though:
http://msdn.microsoft.com/en-us/data/dd363565

这篇关于Oracle.DataAccess错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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