views:

3501

answers:

2

I have installed Oracle 11g r1 64 bit on Windows 7. I am able to connect to it using Sql Developer and a command line tool written in .Net that is 32 bit. I am using Visual Studio to create an ASP.Net application. The solution has 4 projects all of which are compiling for "Any CPU" I installed the 64 bit version of Oracle client and I keep getting the error below. The project is using the System.Data.OracleClient provider. Everything is 64 bit so I don't know why I am getting the error.

[InvalidOperationException: 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.]

A: 

What version of ORacle.DataAccess do you have installed ? Check the GAC:

gacutil /l Oracle.DataAccess

Make sure you have the 64 bit version installed. Also make sure you don't have the 32bit Oracle client on your path before 64 bit client.

I found last week that installing the 32bit Oracle ODP.NET package removes the 64 bit publisher policies...

Jeff Paquette
I have not installed ODP.NET. I am not using the Oracle.DataAccess provider. I am using the System.Data.OracleClient provider that is bundled in .Net
runxc1 Bret Ferrier
A: 

Well not sure if this is the best answer or why this works and the other way doesn't but I installed the 32 bit oracle client after having installed the 64 bit client and was able to get oracle up and running on my dev machine.

So as a recap I installed Oracle for Windows x64, Oracle Client Administrator for x64 and Oracle Client Administrator for 32 bit. I then added tnsnames.ora files to both of the clients that were duplicates of the one created for the DB server and restarted my machine and was able to run my Dev environment Visual Studio 2008 with an asp.net project.

runxc1 Bret Ferrier