locked
System.Data.OracleClient BadImageFormatException RRS feed

  • Question

  • I have an application which was built in .Net 2.0 on 32-bit Windows platform. I am trying to run the same application code in v2.0 using VS2010 but on Windows 7 64-bit platform but I am not able to proceed further due to the following error:


    Exception:

    System.InvalidOperationException was caught

      Message=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.

    Monday, October 17, 2011 5:28 AM

Answers

  • Try these:
    1. Hosting the site on IIS 7 by setting ‘Enable 32-bit application’.
    2. Set the platform for the project using Oracle Provider from ‘Any CPU’ to ‘x86’ in Visual Studio

    • Edited by Saurabh Suri Monday, October 17, 2011 5:32 AM
    • Marked as answer by Ravi_1234 Monday, October 17, 2011 5:33 AM
    Monday, October 17, 2011 5:31 AM

All replies

  • Check if you have Oracle client installed for 64 bit and 32 bit platform
    Monday, October 17, 2011 5:30 AM
  • Try these:
    1. Hosting the site on IIS 7 by setting ‘Enable 32-bit application’.
    2. Set the platform for the project using Oracle Provider from ‘Any CPU’ to ‘x86’ in Visual Studio

    • Edited by Saurabh Suri Monday, October 17, 2011 5:32 AM
    • Marked as answer by Ravi_1234 Monday, October 17, 2011 5:33 AM
    Monday, October 17, 2011 5:31 AM
  • Welcome to MSDN Forums.

    Change "Target Platform" from "Any CPU" to "x86" in properties of the project which builds your application (.exe). Rebuild and try again.

    Sincerely,

    Yasser.

    • Proposed as answer by Saurabh Suri Tuesday, October 18, 2011 3:51 AM
    Monday, October 17, 2011 5:32 AM
  • Saurabh and Yasser, thank you for your active participation in the MSDN forum!

     

    Hi Ravi,
    Welcome to the MSDN forum!

    If you have any questions in the future programming, you are welcome to post again in the forum!

    Have a nice day!
    Yoyo.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, October 18, 2011 9:14 AM
    Moderator