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

后端 未结 4 1580
野性不改
野性不改 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条回答
  •  萌比男神i
    2021-02-06 15:03

    I combined Robert & Arve's answer with my previous efforts :

    • Set SpecificVersion to True in the Project's Oracle.DataAccess properties, and make sure the Version stated matches with the version you want to use. If not, manually edit the csproj file to change the version number and delete the copied dll in the bin folder. Visual Studio would automatically find the version number in the GAC. If the version is not yet exist in the GAC, you should install ODAC first.

    • Make sure the first OraOps11w.dll found in the Path is the version you want to use. If not, change Windows' System Path so that the directory of the Oracle Client you want to use is the first path entry.

    C:\app\user\product\11.1.0\client_1;C:\app\user\product\11.1.0\client_1\bin;other path

    • Disable publisher policy apply in the Web.config or App.config file
    
      
    ...
         
            
    ...
                
                
                
                
            
         
      
    
    

    It might be better to close Visual Studio while editing csproj / web.config files in Notepad++ or your favorite text editor. But usually Visual Studio asks you whether you want to reload the project or not.

提交回复
热议问题