I have a .NET Standard 1.4 class library that references the System.ComponentModel.Annotations (4.3.0) NuGet package.
I\'m then referencing this class library from a
I fixed this error by doing the Clean Solution command in Visual Studio 2019.
I had similar problem but none of the above answers helped me. It turns out that solution is very easy, I've just run following command in Package Manager:
Install-Package System.ComponentModel.Annotations -Version 4.1.0
This usually happens when visual studio can't figure out the correct bindingRedirect.
Most likely the cause it that the version of the nugget does not match the version of the produced library.
To fix do this:
From package manage console do:
Get-Project –All | Add-BindingRedirect
to regenerate assemblyBinding
configuration at the config file
If didn't fix it, then add manually the binding redirection:
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-X" newVersion="Y" />
</dependentAssembly>
where: