0
votes

I am getting below warning when I compile. I added the latest ODP.Net through Nuget and enabled Nuget Restore in my solution. When I searched in the web, some suggested to remove the sections from machine.config. I did but did not solve the problem. Any helps are appreciated. I know it is a warning. But just would like to know what the problem is.

There was a conflict between "Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" and "Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342". "Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" was chosen because it was primary and "Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" was not. References which depend on "Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" [\packages\odp.net.managed.121.1.2\lib\net40\Oracle.ManagedDataAccess.dll]. \packages\odp.net.managed.121.1.2\lib\net40\Oracle.ManagedDataAccess.dll Project file item includes which caused reference "\packages\odp.net.managed.121.1.2\lib\net40\Oracle.ManagedDataAccess.dll". Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL References which depend on "Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" [c:\oracle\product\12.1.0\OraClient12_home1\ODP.NET\managed\common\Oracle.ManagedDataAccess.dll]. Common.dll Project file item includes which caused reference "Common.dll". Common C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,3): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.

2

2 Answers

0
votes

You installed it as a nuget package, but it also exists at c:\oracle\product\12.1.0\oraclient12_home1\odp.net\managed\common..

So what probably happened is this. You originally were referencing ODP.Net installed on disk (probably installed with oracle). Then you upgraded using the nuget package. Which means it's going to be locally in your project's bin folder and no longer depending on the standalone install.

Because you already had a reference to that dll on c:... Nuget did not update the reference.

To fix, remove all your references the ODP.Net in the project reference, uninstall the nuget package, delete your packages folder, and then reinstall the oracle package where it should then pick up the correct reference.

0
votes

My bad. I was referring to the older version of the ODP.Net and was using the below tag in my web.config. As you see the newVersion is set to 4.121.2.0 and the version I used was 4.121.1.0.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <publisherPolicy apply="no"/>
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
        <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>