Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle.DataAccess getting BadImageFormatException: Could not load file....

user630416Nov 19 2009 — edited Nov 20 2009
I have an application build from Visual Studio 8 that is using the System.Oracle.DataAccess library to talk to an Oracle DB. This dll is version 2.111.6.20 x86 version. When I run the application from Visual Studio, it connects, queries and displays the results correctly. This app is running on an Intel Xeon xw8600 processor using XP 2002. But when I deploy this app on an IIS web server that is running on an AMD processor using Windows 2003 server x64, I get the following error:

BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190


Visual Studio is running as a 32 bit application. I also installed ODAC Client 11.1.0.6.21 and win32_11gR1_client.zip for the Oracle Developer's Tools and Client.


I also tried installing the same Oracle Client and Developer's Tools along with VStudio onto the my Windows 2003 server and my app ran fine running under the Visual Studio environment. But when I deployed the app onto the IIS server, I got the same type of error using Oracle.DataAccess version2.111.6.20 x86 version. I then copied over a 64bit version of this dll (version 2.111.6.0 AMD64) and rebuilt /redeployed the app got a different kind of error.

Exception: OCIEnvCreate failed with return code -1 but error message text was not available. System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags) +736 System.Data.OracleClient.OciEnvironmentHandle..ctor(MODE environmentMode, Boolean unicode) +41 System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +214 System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +157 System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +58 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +423736 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection

So all I'm trying to do is to get my app working in an IIS environment. It works when I run it under the VStudio environment on both my client box (x86) and server (x64).
Can anyone help me on this?
Thanks in advance....

Edited by: user630416 on Nov 19, 2009 2:17 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2009
Added on Nov 19 2009
1 comment
2,628 views