I am migrating from a .NET MVC 5 Web Application to a .NET Core 2.2 Web API project along with five .NET Standard 2.0 projects all housed under one solution.
I am now r
Binding redirect (bindingRedirect ) for every assembly you can do it manually in config or there is an option in Project file properties. Check it then upgrade.
The issue is here strong naming and mixed assembly versions for at least "System.Collections.Concurrent", but probably for all the 28 warnings.
I tried going into NuGet at the solution level to install the missing assembly, but 4.0.14 isn't even available in the selection list.
The versions you are seeing are the NuGet versions, and those aren't the same to the assembly versions. e.g. NuGet version 4.3.0-preview1-24530-04 has assembly version 4.0.13.0 for .NET standard 1.3:
Please note that in the same package, the assembly version for netcore50 is 4.0.10.0!
Is this a Microsoft bug?
No it's a feature. When an assembly is strong named., then the full version should match. If not, this will give a warning. When not using the GAC, then only one version of the assembly could be published - so which one if multiple versions are used? Note- all Microsoft's assemblies are strong named.
The problem here:
So two version for one assembly!
There are multiple solutions possible:
Use a <bindingRedirect>
in your .config. See Redirecting Assembly Versions | Microsoft Docs
e.g. for "System.Collections.Concurrent":
<dependentAssembly>
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="4.0.0.0-4.0.14.0" newVersion="4.0.11.0" />
</dependentAssembly>
There are 28 version issues, but there is a big change that multiple issues are solved with a single bindingRedirect. So the best way is to start with one (preferable the most top-level one), and rebuild and repeat until all are resolved.
Please also note that downgrading an assembly is a bit tricky, e.g the assembly built on 4.0.13.0 could use a feature that is introduced/changed in 4.0.11.0+. So you could also update your version and use that version in "newVersion" attribute