locked
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

    Question

  • Hi eveyone,

    Our application require Oracle client and it will fetch the data from the server, we Installed Oracle 10g client 64-bit on win2k3-64bit machine and it able to fetch the data from the database thru console application, same logic was implemented in web application and it is not able to fetch the data. Below error message we are getting .

     

    If anyone have faced similar issue please help me to resolve.


    I refered this post as well http://forums.msdn.microsoft.com/en-US/netfx64bit/thread/3f00bf30-2d81-4e6c-9bcc-16e06ebf46eb/ but this was also not solved my problem

    Is there anything to do with IIS32 bit vs IIS64bit mode??
     

    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

     

    at System.Data.OracleClient.OCI.DetermineClientVersion() at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OracleClient.OracleConnection.Open() at Runaware.SessionPlayback.TestDataBase.GetVendorId() in c:\SmartRec\TestDataBase.aspx.cs:line 43

    Tuesday, August 19, 2008 9:12 AM

Answers

  • hello all,
    I got the root cause of the problem i posted above
    (
    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)

    This will happen  when IIS is running in 32bit mode in Win2k3 64bit OS system, so change IIS to 64bit mode it will stare working.

    1. Type the following command to enable the 64-bit mode:
      cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
    2. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
      %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
    Thursday, August 21, 2008 6:24 AM

All replies

  • The exception is as explicit as it can get, it can't find a 64-bit version of the Oracle client libraries.  This has nothing to do with the .NET framework, please contact Oracle for support.
    Hans Passant.
    Tuesday, August 19, 2008 12:27 PM
  • Actually this is 64bits Asp.net development problem not related to Oracle, in Asp.net you install the correct Oracle client for the operating system where the code will be executed.  So if you are developing the web application in your 32bits operating system you run the code as AnyCPU but make sure IIS 6 is running in 32bits mode.



    Asp.net MVP, MCPD Web C#, MCITP BI & MCTS SQL Server 2005
    Tuesday, August 19, 2008 2:56 PM
  • hello all,
    I got the root cause of the problem i posted above
    (
    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)

    This will happen  when IIS is running in 32bit mode in Win2k3 64bit OS system, so change IIS to 64bit mode it will stare working.

    1. Type the following command to enable the 64-bit mode:
      cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
    2. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
      %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
    Thursday, August 21, 2008 6:24 AM
  • hello all,
    I got the root cause of the problem i posted above
    (
    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)

    This will happen  when IIS is running in 32bit mode in Win2k3 64bit OS system, so change IIS to 64bit mode it will stare working.

    1. Type the following command to enable the 64-bit mode:
      cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
    2. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
      %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i


    Just to be 100% accurate, to register ASP.NET v1.1 on IIS you should really do this instead:

    %SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i

     

    Wednesday, October 20, 2010 1:55 PM
  • Usually, this problem is happening if you haven't set your App Pool correctly.

    1. Right click on your application's virtual directory (with the little Earth sign).

    2. Select "Manage Application".

    3. Select "Advanced Settings".

    4. On Application Pool, select the appropriate application pool for your application, ASP4, ASP.nET v4.0, etc.

    5. Click Okay and it should work for you.

    Wednesday, August 31, 2011 9:31 PM
  • The other option to review when you receive this error is to view your Application_Pools. Check the "Enable 32-Bit Applications". If this is "False", change it to "True". This may resolve your issue.
    Thursday, October 27, 2011 4:13 PM
  • thanks a lot - marvin bland - it worked for me.
    • Proposed as answer by AnupamN.5 Thursday, November 29, 2012 11:35 PM
    • Unproposed as answer by CaddreModerator Tuesday, December 04, 2012 8:04 PM
    Thursday, November 29, 2012 11:15 PM