2

Like How to fix "No way to resolve conflict between" error?, when my project builds there is an error saying :

5>  No way to resolve conflict between "Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342" and "Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342". Choosing "Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342" arbitrarily.
5>  Consider app.config remapping of assembly "Oracle.DataAccess, Culture=neutral, PublicKeyToken=89b483f429c47342" from Version "4.112.1.2" [] to Version "4.112.4.0" [C:\Oracle\11.2\Client_x64\odp.net\bin\4\Oracle.DataAccess.dll] to solve conflict and get rid of warning.

The problem is that, contrary to all other questions on SO, I have no reference to Oracle.DataAccess in my project !

I have also listed all the dependencies of my nugets and none is referencing Oracle.DataAccess directly.

The subtelty is that I have a nuget that needs Oracle.DataAccess 4.112.2.1 to compile but I never packaged it since it must be found in the GAC via the Oracle Client install.

Edit : please note that I do not want to modify the app.config since there are numerous applications and they will be deployed to servers with different Oracle install (i.e I do not want to rewrite the assemblyBinding each time I deploy an application to a server)

Community
  • 1
  • 1
Christophe Blin
  • 1,687
  • 1
  • 22
  • 40

1 Answers1

1

Try adding the following to your app.config file:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Oracle.DataAccess"
          publicKeyToken="89b483f429c47342"
          culture="neutral" />
        <bindingRedirect oldVersion="4.112.1.2" newVersion="4.112.4.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Nissim
  • 6,395
  • 5
  • 49
  • 74
  • I know this will fix the warning during compilation but when I will deploy to my server which has another version of the oracle client, I will need to change it (and I have like 100 applications to deploy to multiple servers with different oracle client install...). Will this cause problem ? – Christophe Blin Aug 24 '15 at 09:25
  • Use a transform when deploying to production. https://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5 https://visualstudiogallery.msdn.microsoft.com/7bc82ddf-e51b-4bb4-942f-d76526a922a0 – Jon Davis Oct 20 '15 at 18:26