One of our dev team member got an error
Attempt to load oracle client libraries threw BadImageFormatException
It seems
This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
But it was me who configured the system - Here's the specifications:
Any thoughts?
1) 32bit Oracle is the Oracle that runs on all operating systems. It has a 4gig (or less, depending on OS) address limit. It uses 32bit pointers which are limited to 4gig. Now, 64bit can address a much larger memory space.
Yes you can do that, there's no limitation regarding that (64-bit, 32-bit).
Instant Client for Microsoft Windows (x64) 64-bit. Continuous innovation with Oracle partner ecosystem to deliver desired outcome for our customers.
I am sorry about adding a second answer but if you have 64 bit and 32 bit clients installed in the same machine you may encounter this problem too.
Two clients installed
C:\oracle\product\11.2.0\client32Bit C:\oracle\product\11.2.0\client64Bit
Control your path Environment Variable. Which Oracle client is first, it is loaded before other one.
echo %PATH% XXXX;C:\oracle\product\11.2.0\client64Bit\BIN;XXX
Since my 64bit Oracle Client is first in PATH, VS.NET tries to use it for Oracle Connections and throws Bad Image Exception.
set PATH=C:\oracle\product\11.2.0\client32Bit\BIN;%PATH% REM Visual Studio 2008 "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" REM Visual Studio 2010 "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
After this you can connect oracle. Of course you can put 32Bit client first in path but I prefer to put 64 bit client before 32 bit for other applications.
Same problem you may face also in Visual Studio 2013 and 64-bit Oracle Client (11 and 12 versions). My solution is:
a) Desktop project. Project properties > Build > disable 'Prefer 32-bit' checkbox.
b) ASP.NET project or web site. Main menu > TOOLS > Options > Project and Solutions > Web Projects > enable 'Use the 64 bit version of IIS Express for web sites and projects' checkbox.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With