Oracle – Is ODP.NET required for Oracle 11g Client

odp.netoracle

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

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).

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.

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.

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

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.

So what Oracle install should I be using?

Edit:

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.

Best Answer

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

  • You don't have to install anything on the target machines (including dev boxes !).
  • You can make sure that your application will run with the specific client you picked.
  • You could even easily have multiple applications work with different client versions on the same computer.
  • As a downside, it adds a significant weight to your application (~19Mb minimum).

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.

Related Topic