Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 18, 2012 12:35 PM by palasataja
Nov 19, 2009 09:35 PM|LINK
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 18.104.22.168 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, Visual Studio is running as a 32 bit application. I also
installed ODAC Client 22.214.171.124.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 version126.96.36.199 x86 version. I then copied over a 64bit version of this dll (version 188.8.131.52 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
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....
Feb 01, 2012 08:44 AM|LINK
Any solutions to this problem?? I have got the same problem
Feb 01, 2012 08:47 AM|LINK
try ading the dlls manually .. that is copy them from your code and add them to the published bin folder
Dec 18, 2012 12:35 PM|LINK
I've struggled with this error for half a day. Thats what helped me:
For x64 machine:
1. Find Oracle.DataAccess.dll in GAC (C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\)
2. Copy to your dependencies folder (if any)
3. Rebuild your project and copy dll to output dir