SoftwareSavant
SoftwareSavant

Reputation: 9737

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

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!

Upvotes: 7

Views: 41255

Answers (5)

Fernando
Fernando

Reputation: 51

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

Upvotes: 1

Elie
Elie

Reputation: 149

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

Upvotes: 5

Abdallah
Abdallah

Reputation: 61

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.

Upvotes: 2

Kishore
Kishore

Reputation: 1

Thanks... this helped me saved time on converting frm 32 bit to 64 bit of our ASP.Net Application...

In Details: APP server looking for client libraries, even we use remoting component to connect to ORACLE db... with ORACLE client 64 bit..

Execption I got was resolved after copying these 5 dll's into my app/bin folder

  1. oci.dll
  2. oraociicu11.dll
  3. oraops11w.dll
  4. orannzsbb11.dll
  5. ociw32.dll

Error Message: The type initializer for 'Oracle.DataAccess.Types.OracleString' threw an exception.

Error Details: System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Types.OracleString' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle client at Oracle.DataAccess.Client.OracleInit.Initialize() --- End of inner exception stack trace ---

Server stack trace: at System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType type) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseMember(ParseRecord pr) at System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary._BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

Upvotes: 0

CodingWithSpike
CodingWithSpike

Reputation: 43698

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

Upvotes: 12

Related Questions