I am currently developing an Asp.net application that connects to an Oracle Database on another server.
it was working fine on my development machine Windows7 32bit (x86) with visual studio 2008 and using Oracle Database 10g Express Edition (32bit).
when running my application on IIS or from VS, the application would easily connect to the Oracle Database with no problem.
Lately i decided to upgrade to Windows7 (x64) machine. But when i ran my application from Visual Studio. I faced the following error:
Exception: 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
So I installed the Oracle Client 10g- x64, and I could successfully connect to the Oracle database using SqlPlus. But using Visual Studio Server Explorer it failed to test the connection with the database. This seemed a bit odd, since i could connect to the db via the oracle client x64.
The problem was that VS2008 is 32 bit and it doesn’t have a 64bit version so in order to use it with Oracle you will need the 32bit client. so I installed the 10204_vista_w2k8_x64_production_client and the 32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio that includes the 32 bit Oracle Instant Client 220.127.116.11.0 and i was able to connect to the db on the spot.
So i have 2 clients running in parallel 64 and 32 bit, and thus the applications that needs 64 bit client can work normally as well as those that needs 32-bit client
Also i added the path to both clients in the PATH environment variable as follows: