I created a .NET standard 2.0 library and I am trying to use it in a 4.6.2 web api project.
When I try to run my web api, I get:
Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
In my web config I have the following redirect:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
I have .NET standard 1.6 as nuget package in the web api project. What am I doing wrong? (I upgraded .NET stndard to 2.0 in the web api project, but that didnt make a difference either)
When I check the bin folder, the System.runtime.dll version is 4.6.255. Why is the version higher than the nuget package it has added.
My package.config file has:
<package id="System.Runtime" version="4.1.0" targetFramework="net462" />