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

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

问题描述

我有一个在Windows环境中运行的asp.net / C#web应用程序。
该项目构建良好,在本地机器的VB.net开发服务器上运行良好。



但是,当我发布到真正的应用服务器时,我收到以下内容错误消息:



[OracleException(0x80004005):提供程序与Oracle客户端版本不兼容]
[TypeInitializationException:'Oracle的类型初始化程序。 DataAccess.Client.OracleConnection'抛出一个异常。]



这个应用程序的一个版本当前正在运行正常,我正在一个不同的实时服务器上进行测试目录。我甚至试图从工作应用程序中阻止Oracle.DataAccess .dll,但仍然收到相同的错误消息。

解决方案

Oracle客户端/提供程序是一团糟。而对于MS一个(反之亦然)以及Oracle一个。



为了通过ODP.NET提供商连接到一个Oracle数据库三件事需要正确设置:




  • Oracle客户端需要正确安装(与.NET提供程序无关,这是指安装的oracle客户端通常在c:\oracle中)

  • ODP.NET提供程序需要与已安装的Oracle客户端兼容

  • 客户端和提供商和您的应用程序需要匹配,您不能使用64位客户端与x86提供商/应用程序,反之亦然



通常最好是拥有两者的最新版本。但是,如果你想摆脱这个问题,一次又一次地使用第三方oracle .NET提供程序。



更新



其中一个来自DataDirect(没有隶属关系):

http://www.datadirect.com/products/net/net-for-oracle/index.html



它不只是安装(不需要oracle客户端),但它也更快,完全管理,x64和一般支持是一种比使用ODP.NET更好的方式。这将会花费你。



DevArt一个也很不错(便宜得多):

http://www.devart.com/dotconnect/oracle/



我们决定DataDirect的可扩展性原因,但是这不应该与您有关。



在这里,您可以找到构建.NET提供程序的第三方的良好编译但不限于oracle:

http://msdn.microsoft .com / en-us / data / dd363565


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): The provider is not compatible with the version of Oracle client] [TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.]

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.

解决方案

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.

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

  • 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

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.

UPDATE

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

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.

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

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

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天全站免登陆