Santanor
Santanor

Reputation: 566

The provider is not compatible with the version of Oracle

I'm running an Oracle XE 10g in a machinem i've created a test app to test some inserts, launched it in a diferent machine and everything worked fine. the problem is when I installed the large app in the same machine where oracle XE is installed. When I launch the app I get this error

Oracle.DataAccess.Client.OracleException The provider is not compatible with the version 
of Oracle client  
en Oracle.DataAccess.Client.OracleInit.Initialize()
       en Oracle.DataAccess.Client.OracleConnection..cctor()
       en Oracle.DataAccess.Client.OracleConnection..ctor()
en Test.DB.Oracle.OracleManagerConnection.GetConnection()

on this line OracleConnection conn = new OracleConnection()

I don't know how can it work from a machine and doesn't work in a different machine. The problem is in a Windows Server 2008 x64 (alredy copied the Oracle.DataAccess.dll to the .exe directory).

Upvotes: 0

Views: 6236

Answers (2)

S.N
S.N

Reputation: 5140

There might be another case, such as running a 64bit .net run-time against a 32bit oracle client. So can you check whether the machine which host small application runs of x64 or 32bit. If it is 32bit, then obviously the copied provider will not work on X64 windows server. In such case, you either need to download 64bit provider version Or set the target CPU flag on large project ( in VS) to run in the 32bit run-time.

Upvotes: 0

Daniel Hilgarth
Daniel Hilgarth

Reputation: 174309

ODP.NET is a real PITA, mainly because the error message are so vague.

The following may trigger this error message:

  • Your Oracle.DataAccess.dll is 32 bit and the unmanaged DLLs it finds and tries to use are 64 bit or vice versa
  • It doesn't find the unmanaged DLLs at all
  • The versions of the unmanaged DLLs are really different to the ones Oracle.DataAccess.dll needs

Please be aware that the process that Oracle.DataAccess.dll uses to locate the unmanaged DLLs is pretty complicated, because it is a multi-step process that takes into account environment variables, registry values etc.

Upvotes: 1

Related Questions