Oracle 11g客户端是否需要ODP.NET? [英] Is ODP.NET required for Oracle 11g Client?

查看:110
本文介绍了Oracle 11g客户端是否需要ODP.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能在这里问错了一个问题,如果愿意,我愿意更改它.

I may be asking the wrong question here, I'm willing to change it if so.

我有一个正在使用Microsoft.NET Oracle提供程序的项目(我们的计划是更改为ODP,但我们尚未这样做).

I have a project that is using the Microsoft.NET Oracle provider (our plan is to change to ODP but we haven't done so yet).

我正在尝试使该项目在Windows 2008(x64)构建服务器上构建.它构建的很好,但是当我们的单元测试在Oracle数据库中命中时就失败了.

I am trying to get this project to build on a windows 2008 (x64) build server. It builds just fine but our unit tests fail when they hit stuff on the Oracle database.

我最初安装了32位oracle 9i客户端,这是我们当前在winxp开发箱和以前的2003年构建服务器上使用的客户端.但是,现在得到的消息是:尝试加载Oracle客户端库时抛出BadImageFormatException.在安装了32位Oracle客户端组件的64位模式下运行时,将发生此问题.

I had initially installed the 32bit oracle 9i client which is what we currently use on our winxp dev boxes and the previous 2003 build server. But now this gets a message like: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

我们尝试编译到x86平台,但这并没有改变错误消息.

We tried compiling to the x86 platform but that didn't change the error message.

我现在已经安装了11g 64位客户端,但是我收到一条消息,提示System.Data.OracleClient需要Oracle客户端软件版本8.1.7或更高版本.

I now have the 11g 64 bit client installed but I am getting a message saying System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

那么我应该使用哪种Oracle安装?

So what Oracle install should I be using?

我能够使它正常工作.原来是通过强制NUnit以32位模式运行而导致问题的测试:

I was able to get this to work. Turned out it was the testing causing the problem, by forcing NUnit to run in 32bit mode: http://geekswithblogs.net/Lance/archive/2006/12/28/102191.aspx I was able to get the tests to work using the old 32 bit driver. This would be a crappy answer to the question so I am not using it but will gladly award the correct answer to anyone putting in some good info on transitioning to Oracle 64bit drivers.

推荐答案

对于Oracle,我喜欢使用

When it comes to Oracle, I like to use Oracle Instant Client :

  • 您不必在目标计算机上安装任何东西(包括开发箱!).
  • 您可以确保您的应用程序将与您选择的特定客户端一起运行.
  • 您甚至可以轻松地在同一台计算机上使多个应用程序与不同的客户端版本一起使用.
  • 不利的是,它给您的应用程序增加了很大的负担(最低约19Mb).

检查

Check What is the minimum client footprint required to connect C# to an Oracle database? for more information. To know how to set up a Visual Studio project that will work on x86 as well as x64 machines, check my blog post Oracle Instant Client in Visual Studio.

这篇关于Oracle 11g客户端是否需要ODP.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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