Installing ODP.net on server to resolve Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client

40,636

Solution 1

There are a lot of little sub versions of the oracle client, and what likely happened is that the oracle clients installed on the machine giving the error isn't exactly the same version that the Oracle.DataAccess.dll file came from.

The best thing to do is make sure you use exactly the same install package on every dev machine and server. This will avoid any missmatch.

As an alternative, what I've done in the past to resolve this (and it may not be the "best" thing to do, but it usually works for me) is to also copy the file OraOps11.dll to your \bin directory, along with the Oracle.DataAccess.dll file.

Get the file from the same oracle install on the same machine where you got Oracle.DataAccess.dll. It should be in a folder named something like this, depending on where you installed Oracle, and what version:

C:\oracle\product\11.1.0\client_1\bin\OraOps11.dll

Solution 2

This worked for me once i ran them:

OraProvCfg /action:config /product:odp /frameworkversion:v2.0.50727 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll

OraProvCfg /action:config /product:odp /frameworkversion:v4.0.30319 /providerpath:C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\4\Oracle.DataAccess.dll

Good luck

Solution 3

I faced exactly the same problem, I tried to copy as much dlls as I can but without any luck.

At the end I had to install "ODTwithODAC121012"(32bit) in the server(Win 2008 R2 64bit).

After installation make sure:

  • PATH is updated with Oracle dlls location: \product\12.1.0\client_1\bin and \product\12.1.0\client_1
  • Restart the server.
  • Enable 32bit for the App Pool in IIS.

Solution 4

I run with the same problem in a Windows 2012 Server that i had Installed Oracle 10.2.0.3 (the supossed oracle 10.2 version compatible with 64 bits) and deployed a web site that used 10.2.0.1 Oracle client.

I tried all solutions in this post but the one that worked form my was the last point of Abdallah answer:

"Enable 32bit for the App Pool in IIS"

Of course I also had to deploy my webapp with the correct Oracle.Data.Access reference (10.2.0.3)

Finally the error message was confusing me because it drived me to be blinded to resolve the version issue, but the really problem was IIS not being capable to excute 32 bits App.

Hope it helps

Share:
40,636
SoftwareSavant
Author by

SoftwareSavant

Software developer 8 years of Software Development experience Have held jobs writing: Java, .Net Code (C#, VB), Javascript (React.js, JQuery) and PHP MSSQL Server queries, views, stored procs and some table design Oracle 10g queries, views, stored procs... No database design experience using Oracle. Prior to my positions in development held jobs on a helpdesk level and on network engineering basis (real simple stuff there)... using System.Web.TehForums; public static void main(string[] args) { System.Console.WriteLine("Hello World"); }

Updated on September 15, 2020

Comments

  • SoftwareSavant
    SoftwareSavant almost 4 years

    I have a test environment for a service that my site will be using and a production environment. In my test environment I have ODP.net installed on the server. That service that uses Oracle seems to be running pretty smoothely so far. I don't appear to have an Oracle Client running on that server at all. On the other hand I have a server which has an Oracle client on it, but doesn't appear to have ODP.net installed on it (I am in the process of double checking, but that is the situation as of this S-O question). On the production server I get this exception:

    Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
    

    in both servers I have the Oracle.DataAccess dll in the bin and lib folders (don't think I need it in the lib folder, but why rock the boat... I am sure you can come up with a good reason, but not right now!!!). My question is do I need to install ODP.net onto the production server? Has that resolved any issues that you have come across? I have seen some SO post that say this resolved a similar issue for them. Could you recommend a course of action? Thank you!

  • SoftwareSavant
    SoftwareSavant over 12 years
    What is OraOps11.dll and what does it do? And that would be in the bin of my application right?
  • SoftwareSavant
    SoftwareSavant over 12 years
    Btw, the version I am using was last modified on 11/9/2010 1:48 AM. So I am pretty sure it is the same version. They are both the 64 bit version as well.
  • CodingWithSpike
    CodingWithSpike over 12 years
    I'm not entirely sure what OraOps11.dll does, but yes, I copy it to whatever folder my application's .exe or .dll is in.
  • Pascal
    Pascal over 11 years
    Worked for me... don't know whey the OraOps11w.dll is needed, but with it, it worked. Tks
  • YavgenyP
    YavgenyP over 11 years
    I cant believe a company oracles size produces such bad products. Seriously, everytime im required to update any of their dlls or version, its like a halfway to commiiting suicide. Why is it so hard for them to manage they own versions correctly?!
  • Greg Z.
    Greg Z. over 8 years
    This solution works for version 12.1.2 (4.121.2.0) of Oracle.DataAccess also. Only in this case the name of the DLL to copy is OraOps12.dll
  • JoshYates1980
    JoshYates1980 about 8 years
    @YavgenyP it's due to a sloppy JAVA framework. I was once told that JAVA is like nailing jello to a tree. This is a prime example why I've wasted so much time troubleshooting these petty Oracle/JAVA problems.