The provider is not compatible with the version of Oracle client

I’m trying to use the Oracle ODP.NET 11g ( Instant Client on my project as a Data Provider but when I run the aspx page I get a “The provider is not compatible with the version of Oracle client” error message. Any help would be appreciated.

I’ve referenced the Data Provider in Visual Studio 2005 and the code behind looks like this:

using Oracle.DataAccess.Client;

OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString =
    "Data Source=MyOracleServerName;" +
    "Integrated Security=SSPI";

//Do Something


The error for the page looks like this:

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

Source Error: 
Line 21: 
Line 22: 
Line 23:             OracleConnection oOracleConn = new OracleConnection();
Line 24:             oOracleConn.ConnectionString =
Line 25:                 "Data Source=MyOracleServerName;" +

[OracleException (0x80004005): The provider is not compatible with the version of Oracle client]
   Oracle.DataAccess.Client.OracleInit.Initialize() +494
   Oracle.DataAccess.Client.OracleConnection..cctor() +483

Stack Trace: 
[TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.]
   Oracle.DataAccess.Client.OracleConnection..ctor() +0
   Boeing.IVX.Web.RoyTesting.Page_Load(Object sender, EventArgs e) in C:Documents and SettingsCE218CDesktopIVX.NetWebIVXRoyTesting.aspx.cs:23
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I’ve been looking into this problem further, and you simply need to grab all the appropriate DLL’s from the same downloaded version of ODP.Net and put them in the same folder as your Exe file, because ODP.Net is fussy about not mixing version numbers.

I’ve explained how to do this here:
Here’s the gist of it though:

  • Download ODP.Net
  • Unzip the file
  • Unzip all the JAR’s in it
  • Grab these dll’s that were just unzipped:
    • oci.dll (renamed from ‘oci.dll.dbl’)
    • Oracle.DataAccess.dll
    • oraociicus11.dll
    • OraOps11w.dll
    • orannzsbb11.dll
    • oraocci11.dll
    • ociw32.dll (renamed from ‘ociw32.dll.dbl’)
  • Put all the DLLs in the same folder as your C# Executable

Method 2

You should “ignore” all the x86/x64 talk here for starters and instead try the ODP.NET Managed Driver (if you are using .Net v4+):

Oracle Managed vs Unmanaged Driver

Avoid all the “unmanaged” what DLL what architecture issues! 😀 (about time Oracle).

The NuGet package (also works for 11g):

enter image description here

The old / manual method:

For info on how to convert to using the managed libraries:

  • First, here is a great code comparison of managed vs unmanaged:
  • Ensure you have downloaded the ODP.NET, Managed Driver Xcopy version only
  • From the downloaded zip file, copy and paste into your project directory:
    • Oracle.ManagedDataAccessDTC.dll
    • Oracle.ManagedDataAccess.dll
  • Add a reference to Oracle.ManagedDataAccess.dll
  • Ensure your exe is released (added to Application Folder in VS2010) with both dlls

Method 3

I only installed the Oracle Data Provider for .NET 2.0 ( and I did not install the Oracle Instant Client (

I just installed it and the error disappeared!

Method 4

This can be caused by running a 64bit .NET runtime against a 32bit Oracle client. This can happen if your server you are running the app on it 64 bit. It will run the .NET app with the 64bit runtime. You can set the CPU flag on your project in VS to run in the 32bit runtime.

Method 5

Let’s make some kind of summary:

Error message “The provider is not compatible with the version of Oracle client” can be caused by several reasons.

  • You have no Oracle Client installed. In this case the error message is indeed misleading.

    Oracle Data Provider for .NET (ODP.NET, i.e. file Oracle.DataAccess.dll) is not included in Oracle Instant Client, it has to be installed separately (download from 32-bit Oracle Data Access Components (ODAC) or 64-bit Oracle Data Access Components (ODAC) Downloads) or you have to select according option in Oracle Universal Installer (OUI).

    Note, when installing the Oracle Data Provider >= 12.1, then the provider is not automatically registered into GAC. You have to register it manually if needed, see Oracle Doc 2272241.1.

  • The version of ODP.NET does not match installed version of Oracle Client. You have to check even the minor version number! For example, Oracle.DataAccess.dll Version is not compatible with Oracle Client Check versions of ODP.NET and Oracle Client carefully. You can use sigcheck on oraociei*.dll and/or OraOps*w.dll to get version of Oracle Client.

    Be aware of different numbering scheme. File version means: .NET Framework Version 4, Oracle Release

    There are ODP.NET version “1.x”, “2.x” and “4.x”. These numbers are related to Microsoft .NET Framework versions 1.0.3705/1.1.4322, 2.0.50727 and 4.0.30319. Version “1.x” was available until Oracle Client 11.1. Version “4.x” was introduced with Oracle Client 11.2

  • The architecture (32bit or 64bit) of ODP.NET does not match your application architecture. A 32bit application works only with 32bit Oracle Client/ODP.NET respectively a 64bit application requires 64bit Oracle Client/ODP.NET. (Unless you use ODP.NET Managed Driver)
  • The .NET Framework version do not match. For example, if you compile your application with Target .NET Framework 2.0 then you cannot use ODP.NET version 4.x. The .NET Framework target version must be equal or higher than version of ODP.NET.
  • The version of Oracle.DataAccess.dll on your development machine (i.e. the version which is loaded while compiling) is higher than the version on the target machine.
  • Be aware that Oracle.DataAccess.dll might be loaded from GAC which by default takes precedence over any locally provided file.


  • Consider to use the ODP.NET Managed Driver, it can be downloaded from Oracle page: 64-bit Oracle Data Access Components (ODAC) Downloads.
    There you only have to copy Oracle.ManagedDataAccess.dll file to your application directory, nothing else is required. It works for both 32bit and 64bit.
  • In your *.csproj, resp. *.vbproj edit your reference to ODP.NET like this:
    <Reference Include="Oracle.DataAccess">

    Attributes like Version=... or processorArchitecture=... are not required. Your application will load the correct Oracle.DataAccess.dll depending on selected architecture and target .NET framework (provided that it is installed properly)
    -> not 100% verified

  • In case you do not know the version of Oracle Client on target machine (e.g. it might be the machine of your customer): Go to the download page mentioned above and download the least XCopy version of Oracle Data Access Components. Extract the zip and copy just the Oracle.DataAccess.dll file to your local machine. In your VS project make a reference to this (most likely outdated) DLL. The version of this DLL is the least version of ODP.NET your application will work with. When you run your application then the Publisher Policy in GAC will redirect to actually installed version.
  • I don’t think it is a smart approach to take single DLL’s and copy them to certain folders. It may work on a “naked” machine but if your target machine has installed any Oracle products there is a high risk for version mismatch. Uninstall any Oracle products from your machine and make a fresh installation. Have a look at How to uninstall / completely remove Oracle 11g (client)? it order to get a really clean machine.
  • In case you have to work with 32bit and 64bit applications at the same time, follow this instruction to install both versions on one machine:

Assumptions: Oracle Home is called OraClient11g_home1, Client Version is 11gR2.

  • Optionally remove any installed Oracle client
  • Download and install Oracle x86 Client, for example into C:Oracle11.2Client_x86
  • Download and install Oracle x64 Client into different folder, for example to C:Oracle11.2Client_x64
  • Open command line tool, go to folder %WINDIR%System32, typically C:WindowsSystem32 and create a symbolic link ora112 to folder C:Oracle11.2Client_x64 (see below)
  • Change to folder %WINDIR%SysWOW64, typically C:WindowsSysWOW64 and create a symbolic link ora112 to folder C:Oracle11.2Client_x86, (see below)
  • Modify the PATH environment variable, replace all entries like C:Oracle11.2Client_x86 and C:Oracle11.2Client_x64 by C:WindowsSystem32ora112, respective their bin subfolder. Note: C:WindowsSysWOW64ora112 must not be in PATH environment.
  • If needed set yor ORACLE_HOME environment variable to C:WindowsSystem32ora112
  • Open your Registry Editor. Set Registry value HKLMSoftwareORACLEKEY_OraClient11g_home1ORACLE_HOME to C:WindowsSystem32ora112
  • Set Registry value HKLMSoftwareWow6432NodeORACLEKEY_OraClient11g_home1ORACLE_HOME to C:WindowsSystem32ora112 (not C:WindowsSysWOW64ora112)
  • You are done! Now you can use x86 and x64 Oracle client seamless together, i.e. an x86 application will load the x86 libraries, an x64 application loads the x64 libraries without any further modification on your system.

Commands to create symbolic links:

cd C:WindowsSystem32
mklink /d ora112 C:Oracle11.2Client_x64
cd C:WindowsSysWOW64
mklink /d ora112 C:Oracle11.2Client_x86

Some notes:

  • Both symbolic links must have the same name, e.g. ora112.
  • In case you want to install ODP.NET manually afterwards, take care to select appropriate folders for installation.
  • Despite of their names folder C:WindowsSystem32 contains the x64 libraries, whereas C:WindowsSysWOW64 contains the x86 (32-bit) libraries. Don’t be confused.
  • Maybe it is a wise option to set your TNS_ADMIN environment variable (resp. TNS_ADMIN entries in Registry) to a common location, for example TNS_ADMIN=C:OracleCommonnetwork.

Method 6

After several hours of troubleshooting, I found this issue to be caused by having Oracle.DataAccess.dll (v4.0) in my projects bin directory, but the runtime also loading Oracle.DataAccess.dll (v2.x) from the GAC. Removing and readding the Oracle.DataAccess entry in the project references solved the problem for me.

The other files mentioned here did not appear to be necessary in my situation.


The root cause of the “The provider is not compatible with the version of Oracle client” error is (generally) that the managed assembly is attempting to load unmanaged libraries which do not match versions. It appears you can force the Oracle driver to use the correct libraries by specifying the library path in the web.config1

      <add name="DllPath" value="C:oraclebin"/>
      <!-- ... -->

Method 7

install ODP.Net on the target machine and it should solve the issue… copying the dll’s does not look a good idea…

Method 8

For Oracle 11g ( I had to add the following dlls along with my Exe to work.

  1. oci.dll
  2. OraOps11w.dll
  3. oraociicus11.dll (pretty huge close to 30mb)
  4. Oracle.DataAccess.dll

Method 9

TLDR Version:

  • Use the 12c 100% managed provider instead.
  • If you must use the old provider, you need to point Oracle.DataAccess.dll to the unmanaged Oracle Client Dlls that are of the correct version. If you have multiple Oracle Clients installed on your machine that maybe a simple as including the “DllPath” configuration variable (see below) in you app config, but you may also need to install a new oracle client to point to.

Full version:

First, lets make sure we understand the components of the old unmnaged provider (not the new 12c 100% managed provider). It’s made up of two pieces:

  1. the managed .net component – Oracle.DataAccess.dll
  2. the unmanaged ( client

Simply speaking, Oracle.DataAccess.dll is nearly just a wrapper, translating .net instructions into ORACLE-NET instructions for the unmanaged client.

That said, when you load Oracle.DataAccess there is a order in which it tries to locate the unmanaged client dlls that it needs. From the Oracle Documentation:

The Oracle.DataAccess.dll searches for dependent unmanaged DLLs (such
as Oracle Client) based on the following order:

1.Directory of the application or executable.

2.DllPath setting specified by application config or web.config.

3.DllPath setting specified by machine.config.

4.DllPath setting specified by the Windows Registry.


5.Directories specified by the Windows PATH environment variable.

So in your case, your app followed this process above and found a path that has unmananged dlls that are too old relative to the Oracle.DataAccess.dll assembly that you are using.

It could just be that the only Oracle Client install on that machine is too old. But this comes into play if you have more than one client installed on the machine and the unmananaged files were found first in a different but older installation. If the later, the simple thing to do is use the dllPath configuration variable in your config and point it at the correct Oracle Home Bin folder:

    <add key="DllPath" value="c:oracleproduct1.1.0-xcopy-depBIN"/>

If you want to install a fresh copy of the client, the xcopy version is the smallest and contains the “instant client” and point the DllPath above to this new location. But any oracle client install will work.

But if you want to avoid all this unmanaged client resolution stuff, see if you can update your app to use the 100% managed provider instead – it truely is just one or two managed assemblies,without any dependency on unmananged files.

Its also possible that you aren’t loading the Oracle.DataAccess.dll that you think you are if it is installed in both your bin directory and your GAC, but I think that is the less likely senario. See the assembly resolution process for more information.

Method 10

It would seem to me that though you have ODP with the Oracle Istant Client, the ODP may be trying to use the actual Oracle Client instead. Do you have a standard Oracle client installed on the machine as well? I recall Oracle being quite picky about when it came to multiple clients on the same machine.

Method 11

I had the exact same problem. I deleted (and forgot that I had deleted) oraociei11.dll after compiling the application. And it was giving this error while trying to execute. So when it cant find the dll that oraociei11.dll, it shows this error. There may be other cases when it gives this error, but this seems to be one of them.

Method 12

Also look for IIS Application pool Enable 32-bit true or false flag, when you see this message, some oracle forum directed me for this!

Method 13

i have the same problem but in my case i can’t just copy the dlls into the bin folder, then i only ‘rebind’ the assembly version.

<?xml version="1.0" encoding="utf-8" ?>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89B483F429C47342" culture="neutral"/>
        <bindingRedirect oldVersion="" newVersion=""/>

Method 14

Here’s what I did to solve this problem that persisted for 3 long hours:

  1. Under Oracle home located at C:oracleproduct11.2.0 I had a folder called client_1 where I had previously installed ODP.NET bits for Windows 64 bits.
  2. Later while trying to debug my ASP.NET Web API app with Visual Studio 2012, I kept getting this error message: The provider is not compatible with the version of Oracle client.
  3. Searching Google I found that this was happening because I was using ODP.NET 64 bits. Then I grabbed ODP.NET for Windows 32 bits and installed it but I kept getting the same error message.
  4. SOLUTION: deleted the folder client_1 and resinstalled ODP.NET 32 bits. Somewhat the installer was mixing bits from the 64 bit version with the 32 bit version. Go figure…
  5. Now I’m happy again and I can open a new OracleConnection. FINALLY! 🙂

Method 15

For anyone still having this problem: based on this article

I found out that my server was missing the Microsoft C++ Visual Runtime Library – I had it on my dev machine because of the Visual Studio installed. I downloaded and installed the (currently) most recent version of the library from here:

Ran the setup and the oracle call from C# made it!

Method 16

I didn’t go down the road of getting new DLL’s. We had a bunch of existing projects that work perfectly fine and it was only my new project that was giving me headache so I decided to try something else.

My project was using an internally developed Internal.dll that depended on Oracle.DataAccess.dll v4.112.3.0. For some reason, when publishing, Visual Studio always uploaded v4.121.0.0, even though it wasn’t explicitly specified in any of the config files. That’s why I was getting an error.

So what I did was:

  1. Copied Internal.dll from one of the successfully running projects to my web site’s /bin (just to be on the safe side).
  2. Copied Oracle.DataAccess.dll from one of the successfully running projects to my web site’s /bin.
  3. Add Reference to both of them from my web site.
  4. Finally Oracle.DataAccess reference showed up in myWebSite.csproj, but it showed the wrong version: v4.121.0.0 instead of v4.112.3.0.
  5. I manually changed the reference in myWebSite.csproj, so it now read:
    <Reference Include="Oracle.DataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86">

Method 17

This issue could by happen while using unmanaged oracle reference if you have more than one oracle client , or sometimes if you reference different version
There is two way to solve it :

  1. First and fast solution is to remove unmanaged reference and use the managed one from NuGet see this before to go with this option Differences between the ODP.NET Managed Driver and Unmanaged Driver
  2. Second solution is to fix project unmanaged target version like the below :
  • First Check oracle project reference version (from project references/(dependencies > assemblies ) > Oracle.DataAccess right click > properties):
    The provider is not compatible with the version of Oracle client

    The provider is not compatible with the version of Oracle client

Then check oracle GAC version

  • got to gac from run (Win+R) “%windir%Microsoft.NETassembly”
    The provider is not compatible with the version of Oracle client
  • Check the platform that matches with you project platform

    The provider is not compatible with the version of Oracle client

  • to check you target platform (right click on your project > properties)

    The provider is not compatible with the version of Oracle client

  • From gac folder search to Oracle.DataAccess

    The provider is not compatible with the version of Oracle client

  • Right Click on Oracle.DataAccess > properties > details and check version

    The provider is not compatible with the version of Oracle client

  • if you notice the versions are different this is an the issue and to fix it we need to redirect assembly version (in startup project go to config file and add the below section )
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />

like this
The provider is not compatible with the version of Oracle client

oldVersion : should be cover your project version
newVersion : GAC version
publicKeyToken : From GAC

The provider is not compatible with the version of Oracle client

Method 18

Does the IIS/IWAM user have permissions on the Oracle directory? Can you connect to this data source using another app, such as Excel or Access?

Method 19

We had the same problem, because the Oracle.Data.dll assembly on a network share was updated by our DBA’s. Removing the reference from the project, and adding it again solved the problem.

Method 20

Just two steps to solve this issue.

  1. go to advance setting of application pool and set ‘Enable 32 bit Application’ flag to True.
  2. Make sure all Dlls in your Bin is 32 bit version now…

best of luck.

Method 21

I encountered this problem after I installed Oracle Data Tools for Visual Studio 2015, and then fighting with Oracle for a good hour. I decided to try reinstalling Oracle client again instead of this mess with file copying, config changes, etc., and that worked for me.

Method 22

I faced a similar issue and the root cause was that GAC had 2 oracle.dataaccess versions i.e. v4.0_4.112.2.0 and v4.0_4.112.4.0 . My application was referring to v4.0_4.112.2.0 , so when I removed v4.0_4.112.4.0 from GAC, it worked fine.

GAC path : C:WindowsMicrosoft.NETassemblyGAC_64Oracle.DataAccess

Before :
enter image description here

After :
enter image description here

To remove a version, one can simply delete the corresponding folder from GAC.

Method 23

Recently I had to work on an older project where the solution and all contained projects were targeted to x32 platform. I kept on trying to copy Oracle.DataAccess.dll and all other suggested Oracle files on all the places, but hit the wall every time. Finally the bulb in the head lit up (after 8 hours :)), and asked to check for the installed ODAC assemblies and their platform. I had all the 64-bit (x64) ODAC clients installed already but not the 32 bit ones (x32). Installed the 32-bit ODAC and the problem disappeared.

How to check the version of installed ODAC: Look in folder C:Windowsassembly. The “Processor Architecture” property will inform the platform of installed ODAC.

Eight hours is a long time for the bulb to light up. No wonder I always have to slog at work :).

Method 24

Chris’ solution worked for me as well. I did however get a follow error message that states:

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Apparently, in the foreign language of Oraclish, that means that your program are either targeting all platforms, or 32-bit machines.
Simply change your target platform in Project Properties to 64-bit and hope for the best.

Method 25

I had the same issue with Oracle.DataAccess.dll v4.121.2.0. with 2- homes installation (32 and 64 bit versions). 32-bit version workerd, 64-bit version didn’t.

In my case (after 2 days of trying) I found that the problem was permissions on the 64-bit-home version. Many Directories in that version had exclusively overridden permissions where “Authenticated Users” role did not have “Read” access, which is set by default on the parent directory. Those sub-directories included “bin”, “network/admin”, “nls”, “oracore”, “RDBMS” and possibly others. I found them by filtering out “ACCESS DENIED” result in “Process Monitor” (Procmon.exe) utility from sysinternals. Once the permissions were inherited from the parent directory to those child subdirectories everything started to work.

I didn’t what to override the permissions on the whole oracle home so I did them one directory at a time, but I guess if you don’t worry about security so much you can reset it on the whole corresponding oracle home directory.

Method 26

  • On a 64-bit machine, copy “msvcr71.dll” from C:WindowsSysWOW64 to
    the bin directory for your application.
  • On a 32-bit machine, copy “msvcr71.dll” from C:WindowsSystem32 to
    the bin directory for your application.

Method 27

Lots of theoretical answers here, but here comes a working example with code that you can copy and paste and test immediately:

  1. I installed the Oracle Express database OracleXE112 which already comes with some preinstalled demo tables.
  2. When you start the installer you are asked for a password. I entered “xxx” as password. (not used in production)
  3. My server runs on the machine
  4. On the server you must explicitely allow access for the process TNSLSNR.exe in the Windows Firewall. This process listens on port 1521. If you get a timeout error from the below code check your firewall.
  5. OPTION A: For C# (.NET2 or .NET4) you can download ODAC11, from which you have to add Oracle.DataAccess.dll to your project. Additionally this DLL depends on: OraOps11w.dll, oci.dll, oraociei11.dll (130MB!), msvcr80.dll.
    These DLLs must be in the same directory as the EXE or you must specify the DLL path in: HKEY_LOCAL_MACHINESOFTWAREOracleODP.NET4.112.4.0DllPath. On 64 bit machines write additionally to HKLMSOFTWAREWow6432NodeOracle...
  6. OPTION B: If you have downloaded ODAC12 you need Oracle.DataAccess.dll, OraOps12w.dll, oci.dll, oraociei12.dll (160MB!), oraons.dll, msvcr100.dll. The Registry path is HKEY_LOCAL_MACHINESOFTWAREOracleODP.NET4.121.2.0DllPath
  7. OPTION C: If you don’t want huge DLL’s of more than 100 MB you should download in which you find Oracle.ManagedDataAccess.dll which is only 4 MB and is a pure managed DLL which works in 32 bit and 64 bit processes as well and depends on no other DLL and does not require any registry entries.
  8. The following C# code works for me without any configuration on the server side (just the default installation):
using Oracle.DataAccess.Client;
using Oracle.ManagedDataAccess.Client;


string oradb = "Data Source=(DESCRIPTION="
    + "User Id=SYSTEM;Password=xxx;";

using (OracleConnection conn = new OracleConnection(oradb)) 
    using (OracleCommand cmd = new OracleCommand())
        cmd.Connection  = conn;
        cmd.CommandText = "select TABLESPACE_NAME from DBA_DATA_FILES";

        using (OracleDataReader dr = cmd.ExecuteReader())
            while (dr.Read())

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x