tags:

views:

3800

answers:

5

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.

A: 

I have found many times that the error "requires Oracle client software version 8.1.7 or greater" is a notoriously misleading error. From distant memory I seem to remember that this usually indicates a file IO permissions problem. I think it may be that the ASP.NET worker process (or whichever identity an application is running under) requires some sort of read or write permission to a folder in the oracle client folder hierarchy...

rohancragg
+1  A: 

I think the message "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater" it's similar to "Oracle client not installed, installed but not found or installed but it's needed 8.1.7 or greater".

Check on regedit if the values are right under the key:

 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraOdac11g_home1

Where OraOdac11g_home1 depends on the Oracle Home name for your installation.

Also, try to connect through Visual Studio to see if its possible.

FerranB
A: 

This can be a cause of multiple oracle homes in the environment. Remove the older version oracle home in your build system. try generating the build again with the single home. There are some issues with 9i version ODP.NET and 10G/11G connectivity

Govind
+1  A: 

I have had an issue which could relate to what you are seeing.

I initially had the just the Oracle 10g client installed on my machine and the .Net Oracle.DataAccess component version number was 10.2.0.100 - this was for .Net runtime v1.0.3705

I installed ODP.Net and the Oracle.DataAccess component version is now v2.102.2.20 and runs on .Net runtime v2.0.50727 - I cant find the reference as to why Oracle did this - it was something to do with bringing version numbers in line with the runtime version

It took me a day to work this out. We dont use the 11g client yet and I havent used the 8i client for ages so I dont know what the version numbers would be for those clients, but I'd check it if I were you what.

In short, Oracle back-tracked the component version numbers which could be making your 11g component appear out-of-date as opposed to Oracle 8i components

Chris Gill
+2  A: 

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.

Mac