The provider is not compatible with the version of Oracle client

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

    
          
            
            
          
    
    
    

    like this

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

提交回复
热议问题