Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle.DataAccess.dll can not be located though it exists

Tags:

asp.net

oracle

When I browse ASP.Net application developed in Visual Studio 2008 on IIS 7.5(Windows Server 2008 R2 x64) I get configuration error stating that Oracle.DataAccess, Version=2.111.7.20 file could not be located. I've already installed Oracle Data Provider for .NET which contains the file. When I setup ODP.net it places the dll files into c:\app....\odp.net\PublisherPolicy folder. I just in case copied those files to C:\Windows\Microsoft\Framework folder too, but still I got the same error. Could someone please help me solve this issue? Any help is greatly appreciated

like image 547
Mikayil Abdullayev Avatar asked Dec 22 '22 04:12

Mikayil Abdullayev


1 Answers

The ODP.NET installation can be very tricky. There are many things that can go wrong:

  • You can have a version mismatch (2.111.7.20 vs 2.112.1.0 vs. 2.112.2.0).
  • You can have a mismatch between 32 and 64 bit.
  • The .NET DLL might exists but one of the dependencies is not found.

Try to check the 32/64 bit mismatch first. In IIS, you can configure whether your web application runs as 32 or 64 bit. To check it, have a look at the task manager and see whether the w3wp.exe process has the *32 mark. Then go to C:\Windows\Assembly in the file explorer. It's a special view that display the GAC. If it says x86 in the last column on the row Oracle.DataAccess, then it's 32 bit. If it says AMD64, then it's 64 bit.

On the same row, you'll also find the exact version number. Check in VisualStudio, whether the ASP.NET project uses the same one.

If I'm not mistaken, the main dependency of Oracle.DataAccess.dll is OraOps11w.dll, which should be available in the BIN directory of the Oracle client directory. This directory is usually located via the registry (HKLM\SOFTWARE\ORACLE\ODP.NET\<version>\DllPath). Make sure you look at the registry of the correct bitness (32 vs 64 bit).

There are more things that can go. But these here usually solve the problem.

like image 163
Codo Avatar answered Jan 09 '23 04:01

Codo