Thursday, October 18, 2007

Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies.

I am moving an ASP.NET 2.0 application to another environment. On the new server I get the following error on my Web page:

Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I notice the client is 10.1 on the server so I install 10.2:
Oracle Database 10g Client Release 2 (10.2.0.1.0)
Selected 'Administration' in the installation to get all of the BIN files.

NOTE: ORACLE_HOME Environment Variable is no longer used.



I install ODAC on the server:
Oracle10g Release 2 ODAC 10.2.0.2.21

I did not realize that a different 10.2 client was installed on my local:

Local
Oracle Data Provider for .NET 10.2.0.2.20 Production
The Oracle.DataAccess.dll is pathed to: D:\oracle\product\10.2.0\client_1\odp.net\bin\2.x
Web.config:


Server
Oracle Data Provider for .NET 10.2.0.1.0
The Oracle.DataAccess.dll is pathed to: D:\oracle\product\10.2.0\client_1\BIN

So, I'm thinking that if I just modify the Web.config, it will work:


I get this error: "The provider is not compatible with the version of Oracle client"

I copy the Oracle.DataAccess.dll from local to the BIN directory of the ASP.NET application, and then over to the server. Modifying the Web.config does not resolve the issue.

Solution


After spending more time wrestling with a connection, I find out that our DBA's have a copy of the older ODAC (which I can't find on the Oracle site).

Now I get another error:
"Unable to load DLL 'OraOps10w.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)"

I added the ASPNET account to the BIN folder security settings and propigated the permissions, but still received the error. The magic bullet was - RE-BOOT! It works!

In searching the forums I found someone of "like mind":
"We should not have to install anything on the server, especially not 400+ MB of oracle client tools just to connect to and query a database."

1 comment:

Asthalas said...

This is something I usually don't do, but I can't help it: I hate Oracle because of that very same installation issue.
So there goes my ME TOO.

Check This Out!

More Links to Good Information