Oracle.Dataaccess is in the GAC. Can I control the version I use?

后端 未结 4 1570
野性不改
野性不改 2021-02-06 14:32

I have a XCOPY deployable .NET application using Oracle.DataAccess (ODP.NET). We also deploy the Oracle Instant client in the application directory. Everything works OK, but I w

4条回答
  •  無奈伤痛
    2021-02-06 15:12

    It's possible to force your application to always use the ODP and ODAC version you want.

    1. Force ODP version: use the assemblyBinding trick posted by Robert, to force using your version of Oracle.DataAccess instead of the GAC'd version. E.g.:

      
        
          
            
              
              
            
          
        
      
      
    2. Force ODAC version: The ODP DLL depends on a set of shared Oracle components (instant client, unmanaged OCI dlls). One way to get these is via the ODAC package. You can define (on a per app basis), which ODAC package you want to use. Traditionally this was done via the PATH env variable, but it can now be defined via config:

      
        
          
    3. As an extra precaution, you can always delete the GAC'd publisher policy DLL, to ensure there is never any funky going on.

提交回复
热议问题