Home » .Net FrameworkRSS

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when

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

 

4 Answers Found

 

Answer 1

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.
 

Answer 2

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
 

Answer 3

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.

Type the following command to enable the 64-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
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
 

Answer 4

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.

Type the following command to enable the 64-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
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

 

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter