I have a .net 4.7 project which has installed the version 4.3.0 of System.Runtime. But when I run the project I get an exception that say that it can't be found the version 4.1.0.0.
If I go to the nuget manager, I install the version 4.1.0.0 in the project, then it works. So I have tried to update again to the version 4.3.0, but again, I get the problem.
The project was working until now, really I don't know why it stops to work because I don't touch anything related with the nuget packages.
Also I have tried to created a new empty solution and add the project, to try a fresh solution, but the problem is the same.
How could I solve the problem?
Thanks.
NuGet should generate the necessary binding redirects into the App.config for packages.config based projects or set AutoGenerateBindingRedirects to true for csproj files using PackageReference to reference NuGet packages.
If for some reason this did not happen or you are using the libraries from a different project / application, it may be necessary to add the binding redirect manually to the app.config / web.config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With