Organizational Research By

Surprising Reserch Topic

could not load file or assembly for oracle dataaccess in net


could not load file or assembly for oracle dataaccess in net  using -'.net,oracle,assemblies'

When I try to run a simple program to access oracle I am getting this message


  Could not load file or assembly 'Oracle.DataAccess,
  Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342'
  or one of its dependencies. The system cannot find the file specified.


I checked \windows\assembly and it's in there, but it's not in GAC (gacutil -l). I can't add into GAC  (gacutil -i [path]. I get 'unknown error'.

Anyone has the same experiencing?
    

asked Sep 15, 2015 by WendellJHXN
0 votes
84 views



Related Hot Questions

6 Answers

0 votes

I'm going to give you the answers from what I've just went through on Windows Server 2008 R2 which is a 64 bit operating system. The application suite of libraries I was given were developed using .net 3.5 x86 with the older DLL libraries and I was stuck because I had installed the newer x64 clients from oracle.

What I found was the following: Install the latest x64 client from Oracle for Windows Server 2008. I believe this would be the 2.7.0 client. When you select the installation, make sure you do custom and select the .NET libraries. Configure your tnsnames files and test your tnsping against your data source.

Next, if you are running a 32 bit application, install the same version of the client for 32 bit. Also, follow the same installation routine, and select the same home.

When your finished, you will find that you have a single app/product with two client directories (Client1 and Client2).

If you navigate to the windows/assemblies directory you will find that you have a reference to the Oracle.DataAccess.dll (x2) with one for x86 and one for AMD64.

Now, depending on if you have developers or are developing on the machine yourself, you may be ok here, however, if they are using older drivers, then you need to perform one last step.

Navigate to the app\name\product\version\client_1\odp.net\publisher policy\2.x directory. Included in here are two policy files. use gacutil /i to install the Policy.2.111.Oracle.DataAccess.dll into the GAC. This will redirect legacy oracle ODP calls to the newer versions. So, if someone developed with the 10g client, it will now work with the 11 client.

FYI -- Some may be installing the latest ODP.NET with the 2.111.7.20. The main oracle client itself comes with 2.111.7.0 .. I've not had any success with the 7.20 but have no issues with the 7.0 client.

answered Sep 15, 2015 by AshFluharty
0 votes

Like it is referred on the first answer, there are 32/64 bit scenarios which introduce build and runtime pitfalls for developers. The solution is always to try to get right what kind of software and OS you have installed. For a small list of scenarios with the Oracle driver and the solution, you can visit this post: http://rambletech.wordpress.com/2011/09/26/could-not-load-file-or-assembly-oracle-dataaccess-error/

answered Sep 15, 2015 by Kee9011
0 votes

I had the same issue.

Solution was to change the platform of my current solution to x64.

To do that in Visual Studio, right click solution > Configuration Manager > Active Solution Platform.

answered Sep 15, 2015 by JennieDtqmdj
0 votes

I switched over to the managed ODP.NET assemblies from Oracle. I also had to purge all the files from the IIS web apps that were using the older assemblies. Now I don't get any conflicts regarding 32 vs 64 bit versions when I debug in IIS Express vs IIS. See the following article.

An Easy Drive to .NET

answered Sep 15, 2015 by EllHurtado
0 votes

in your .net project go to reference section, right click on Oracle.DataAccess dll, goto properties.

Change the setting to "Specific Version=False". Now it will be no version conflict

answered Sep 15, 2015 by MyrtisYancey
0 votes

In my case the error states that the assemly

Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342

is missing.

When I run gacutil.exe /l 'Oracle.DataAccess' the result was:

The Global Assembly Cache contains the following assemblies:
Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86

Number of items = 1

At this moment I have just installed the oracle client: win32_11gR2_client

Then I installed oracle developer tools ODTwithODAC112030_deleloper_tool

Now gacutil is saying:

The Global Assembly Cache contains the following assemblies:
Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86

Number of items = 2

Fixed, one totally missing assembly case

answered Sep 15, 2015 by RichardDore6

...