我创建了一个.NET标准2.0库,我试图在4.6.2 web api项目中使用它。System.Runtime 4.1.0.0无法在.net中使用.net标准2.0 lib 4.6.2
当我尝试运行我的Web API,我得到:
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.
在我的web配置我有以下重定向:
<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>
我有.NET 1.6的标准作为NuGet包中web api项目。我究竟做错了什么? (我在.NET api项目中将.NET stndard升级到2.0,但这也没有什么不同)
当我检查bin文件夹时,System.runtime.dll版本是4.6.255。为什么版本高于它添加的nuget软件包?
我package.config文件有:
<package id="System.Runtime" version="4.1.0" targetFramework="net462" />
有什么理由不更新版本重定向到4.6.255? –
@KevinHirst我试着重定向到4.6.255,但这也没有帮助。我想知道是否在.net framework 4.6.2项目中使用.net标准库存在某种问题? – Kaladin
@Win我看到那个线程,但它不能帮助我。 – Kaladin