The provider is not compatible with the version of Oracle client

前端 未结 27 1177
一生所求
一生所求 2020-11-22 05:37

I\'m trying to use the Oracle ODP.NET 11g (11.1.0.6.20) Instant Client on my ASP.net project as a Data Provider but when I run the aspx pag

相关标签:
27条回答
  • 2020-11-22 06:32

    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.

    0 讨论(0)
  • 2020-11-22 06:32

    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.

    0 讨论(0)
  • 2020-11-22 06:33

    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+):

    https://www.nuget.org/packages/Oracle.ManagedDataAccess/

    https://www.nuget.org/packages/Oracle.ManagedDataAccess.EntityFramework/

    Oracle ODP.net Managed vs Unmanaged Driver

    Avoid all the "unmanaged" what DLL what architecture issues! :D (about time Oracle).

    The NuGet package (also works for 11g):

    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: http://docs.oracle.com/cd/E51173_01/win.122/e17732/intro005.htm#ODPNT148
    • 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
    0 讨论(0)
  • 2020-11-22 06:33

    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:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess

    Before :

    After :

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

    0 讨论(0)
  • 2020-11-22 06:33
    • On a 64-bit machine, copy "msvcr71.dll" from C:\Windows\SysWOW64 to the bin directory for your application.
    • On a 32-bit machine, copy "msvcr71.dll" from C:\Windows\System32 to the bin directory for your application.

    http://randomdevtips.blogspot.com/2012/06/provider-is-not-compatible-with-version.html

    0 讨论(0)
  • 2020-11-22 06:36

    For Oracle 11g (11.1.0.7.20) 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
    0 讨论(0)
提交回复
热议问题