The provider is not compatible with the version of Oracle client

前端 未结 27 1130
一生所求
一生所求 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:18

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

    I just installed it and the error disappeared!

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

    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.

    UPDATE

    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

    <configuration>
      <oracle.dataaccess.client>
        <settings>
          <add name="DllPath" value="C:\oracle\bin"/>
          <!-- ... -->
        </settings>
      </oracle.dataaccess.client>
    </configuration>
    
    0 讨论(0)
  • 2020-11-22 06:18

    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.

    0 讨论(0)
  • 2020-11-22 06: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.

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

    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: http://splinter.com.au/using-the-new-odpnet-to-access-oracle-from-c 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
    0 讨论(0)
  • 2020-11-22 06:20

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

    0 讨论(0)
提交回复
热议问题