The provider is not compatible with the version of Oracle client

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

    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!

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

    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.

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

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



    Then check oracle GAC version

    • got to gac from run (Win+R) "%windir%\Microsoft.NET\assembly"

    • Check the platform that matches with you project platform

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

    • From gac folder search to Oracle.DataAccess

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

    • 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">
          <dependentAssembly>
            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="4.121.2.0" />
          </dependentAssembly>
    </assemblyBinding>
    
    

    like this

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

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

    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" ?>
    <configuration>
      <runtime>    
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89B483F429C47342" culture="neutral"/>
            <bindingRedirect oldVersion="2.112.2.0" newVersion="2.112.1.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    
    0 讨论(0)
  • 2020-11-22 06:17

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

    1. Under Oracle home located at C:\oracle\product\11.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! :)

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

    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:\Windows\assembly. 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 :).

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