与How to fix "No way to resolve conflict between" error?一样,当我的项目构建时,会出现错误:
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.
问题是,与SO上的所有其他问题相反,我的项目中没有提及Oracle.DataAccess!
我还列出了我的nugets的所有依赖项,没有一个直接引用Oracle.DataAccess。
该子网是我有一个需要Oracle.DataAccess 4.112.2.1编译的nuget但我从未打包过它,因为它必须通过Oracle Client安装在GAC中找到。
编辑:请注意我不想修改app.config,因为有很多应用程序,它们将部署到具有不同Oracle安装的服务器上(即我不希望每次部署应用程序时都重写assemblyBinding到服务器)
答案 0 :(得分:1)
尝试将以下内容添加到app.config文件中:
<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>