Found conflicts between different versions of the same dependent assembly when referencing Microsoft.Orleans.Server 1.3.0
Hi,
I have upgraded to 1.3.0 but I now get the warning "Found conflicts between different versions of the same dependent assembly" when Microsoft.Orleans.Server is referenced. I am using the NuGet 3 project.json file to manage packages. I have tested this on an empty project with only Orleans references added and the warning remains, using Orleans 1.2.4 builds with with no warnings. I have enabled AutoGenerateBindingRedirects in the csproj file for now.
Logging from build:
1> Consider app.config remapping of assembly "System.Reflection, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Reflection.dll] to Version "4.1.0.0" [C:\Users\corlessr.nuget\packages\System.Reflection\4.1.0\ref\net462\System.Reflection.dll] to solve conflict and get rid of warning. (TaskId:36) 1> Consider app.config remapping of assembly "System.Runtime.Extensions, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Runtime.Extensions.dll] to Version "4.1.0.0" [C:\Users\corlessr.nuget\packages\System.Runtime.Extensions\4.1.0\ref\net462\System.Runtime.Extensions.dll] to solve conflict and get rid of warning. (TaskId:36) 1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
Thanks, Rich
I'm targeting .NET 4.6.1 so don't see that exact warning, but do have others I was able resolve.
In the app configuration (web.config or app.config), add the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Reflection"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0"
newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0"
newVersion="4.1.0.0" />
</dependentAssembly>
...
</assemblyBinding>
</runtime>
</configuration>
I had already tried adding that as the usual fix (sorry, stupid not to mention that). I also get the warning on 4.6.1, but only on an executable project, a class library has no conflict.
As it was fine with 1.2.4 I was wondering if there is a mismatch with references in the latest release?
Rich
Could there be an issue with NuGet caching similar to https://github.com/dotnet/orleans/issues/2301?
I have tried it at home on a different computer and still the same warning. I haven't download the Orleans packages on this one before. I also cleared the packages cache on both computers.
I have noticed that while creating a new solution and exe project the AutoGenerateBindingRedirects is added and set to true by default. So you wouldn' notice it on new projects. I'm thinking I will just leave this enabled on my proper project file if it is now the default setting.