Click here to Skip to main content
15,353,416 members
Please Sign up or sign in to vote.
1.86/5 (4 votes)
See more:
Hi All,

I have installed a Web application on IIS 7.0 windows server 2008 R2 64 bit OS
I am refering a oracle.DataAccess.dll
When i try to acess the application i am getting the below message
"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.".

Please help me.

Thanks in Advance.
Updated 11-Aug-20 22:42pm

It seems the Oracle Data Access Component installation process using the "11.2 Release 3 ( with Xcopy Deployment" version is broken. To fix this you must register the missing assemblies in the GAC. To do this for this specific version run these commands from within an administrator console:

md C:\Windows\assembly\GAC_32\Oracle.DataAccess\\

copy %ORACLE_HOME%\\bin\4\Oracle.DataAccess.dll C:\Windows\assembly\GAC_32\Oracle.DataAccess\\

md C:\Windows\assembly\GAC_32\Oracle.Web\\

copy %ORACLE_HOME%\\bin\4\oracle.web.dll C:\Windows\assembly\GAC_32\Oracle.Web\\

Note that this registers only the DLL's but not other languages resources. So, if you are using any another language than English (de, es, fr, it, ja, ko, pt-BR, zh-CHS, and zh-CHT), then you need to register these as well using the corresponding resource file.

If you have Visual Studio installed on the machine, you can issue the following commands instead:

gacutil /i %ORACLE_HOME%\\bin\4\Oracle.DataAccess.dll
gacutil /i %ORACLE_HOME%\\bin\4\oracle.web.dll

Note: look for gacutil.exe under the Visual Studio installation folder for it.

Hope this helps.

[no name] 22-Aug-13 4:17am
Didn't work at first, but then I just 'bombarded' the GAC with all the versions of these dll's I could find on my computer. Thank you SO much for this hint! This was killing me! The problems originated when I tried to install and then de-install some Oracle components and decided to 'clean up things' a little in the process.
hi make sure that you have more than one default application pools but you should set the 32-bit to your active default pool
Thando Khumalo 13-Nov-12 8:31am
Am using a 64-bit but i get the same error message
On IIS turn to true the advance setting
Enabled 32 bit Application = true
There can be two things. Either you have not put the ODP dll in the website folder or it is 32 bit on 64 bit computer or vice versa. Please check that.
I switched to the Managed ODP.NET assemblies. I also had to clear out all files from IIS apps that were using the older assemblies.
In my case I might to publish in 64 bit mode (Setting to "Any Cpu" mode in Web Project configuration) and I might set IIS on Production Server to 32 Bit compability to false (because the the server is 64 bit and I like to take advantage it).

Then to solve the problem "Could not load file or assembly 'Oracle.DataAccess'":

-Oracle.DataAccess.dll in the PC local (C:\app\user\product\11.2.0\client_1\\bin\4\) is the 64 bit. In the Local PC and Server is installed Oracle v11, 64 Bit.
-In IIS Production Server, I set 32 bit compatibility to False.
-The reference in the web project at System.Web.Mvc.dll was the version v3.0.0.1 in the local PC, however in Production is only instaled MVC version So, the fix was locallly work with MVC and not and publish again on server, and it works.
Kats2512 5-Jul-18 8:59am
question that was asked and answered 7 years ago...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900