This discussion is archived
7 Replies Latest reply: Oct 9, 2013 7:32 PM by Christian.Shay - Oracle RSS

running in 64 bit mode with the 32 bit Oracle client installed

940950 Newbie
Currently Being Moderated
I have seen many postings on this issue but none of the suggested solutions have helped me.

I am running visual studio 2010 professional with SP1 on windows 7 64 bit machine. When I try to run a web service locally and call it with SoapUI, I get the following error message during OracleConnection.Open().

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.


I have tried setting up the build configuration and the project settings to target 32 bit but that has not helped. I have also tried removing the reference to System.Data.OracleClient that shows being under Program Files (x86) and add a new reference to the dll under GAC_64. That too did not work.

I only have the 64 bit client installed on my machine.

Any help will be appreciated.

Thank you
  • 1. Re: running in 64 bit mode with the 32 bit Oracle client installed
    gdarling - oracle Expert
    Currently Being Moderated
    To the best of my knowledge, the personal web server that gets invoked when debugging in VS is a 32 bit process, so you'd need to have 32 bit client installed. You should be able to check the processes tab in task manager to confirm/deny that. If the process name has *32 next to it, it's 32 bit.

    While the error message states "This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed", it happens the other way around as well.

    Hope it helps, corrections/comments welcome.

    Greg

    Edited by: gdarling on May 31, 2012 3:20 PM
  • 2. Re: running in 64 bit mode with the 32 bit Oracle client installed
    940950 Newbie
    Currently Being Moderated
    The task does not show that it is running in 32 bit mode. However, I installed the 32 bit version of Oracle and that error message went away. Looks like the error message is not entirely accurate. It should state "32 bit mode with the 64 bit Oracle client installed".

    Thank you for the assistance.
  • 3. Re: running in 64 bit mode with the 32 bit Oracle client installed
    944916 Newbie
    Currently Being Moderated
    I seem to have had a problem very similar to yours. Same VS, Windows 7, error message, etc. I fixed it by unloading the reference C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Data.OracleClient.dll from my VS2010 project and replacing it with C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.OracleClient.dll Note the Framework instead of Framework64. The filenames and properties are the same so you wouln't know which version you were running unless you knew where it came from.
  • 4. Re: running in 64 bit mode with the 32 bit Oracle client installed
    959513 Newbie
    Currently Being Moderated
    So, If I want to install ODAC 32bit on Windows Server 2003 64bit,will it connect to Oracle database?
  • 5. Re: running in 64 bit mode with the 32 bit Oracle client installed
    Tridus Journeyer
    Currently Being Moderated
    Your 32 bit applications will, yes.

    (Note that the rest of this thread mentions System.Data.OracleClient, which is something else entirely. That's a Microsoft supplied provider that is no longer supported. It's not the same thing as installing ODAC.)
  • 6. Re: running in 64 bit mode with the 32 bit Oracle client installed
    817250 Newbie
    Currently Being Moderated

    1. Visual Studio any version is 32 bit ONLY irrespective of hardware or OS bits.  So to DEVELOP with Oracle Client you MUST install 32 bit Oracle ODAC components. Task manager will show devenv.exe *32 (to confirm 32 bit Visual Studio application).

    2. You can run your web application inside IIS/IIS Express in your PC which independently can be either 32bit or 64bit.  If it is 64 bit, you MUST also install 64 bit Oracle ODAC components which means you'll have to install both 32bit and 64bit in your 64 bit Win7 running on 64bit hardware.

    3. In Visual Studio if you compile with "AnyCPU" as target, the resultant binaries (Web/NonWeb) can be both 32bit or 64bit.  So if target PC is "AnyCPU" or "x64", you MUST install Oracle ODAC 64 bit in the target OS if that target OS is 64bit.  You don't have to install 32bit ODAC in the target PC.

    4. One more catch to above scenario is the target OS could be 64bit simulated OS on a 32bit hardware. In such case you MUST install both 32bit and 64bit ODAC components.

     

    So while you ask your network team to download ODP.NET/ODAC Components make sure you ask them to download both 32bit and 64bit. Total nearly 600MB.

     

    Hope this helps many people out there.

  • 7. Re: running in 64 bit mode with the 32 bit Oracle client installed
    Christian.Shay - Oracle Pro
    Currently Being Moderated

    And now there is ODP.NET fully managed driver, which does not care if the OS is 32-bit or 64-bit.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points