[英]Assembly uses version X which has a higher version than referenced assembly error
After upgrading from ASP.NET Core 2.0 to 2.1-preview2 I got the following error: 从ASP.NET Core 2.0升级到2.1-preview2后,我收到以下错误:
Error CS1705 Assembly 'System.Data.SqlClient' with identity 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
When I look around for similar errors, I see a lot of discussions about the versions that are referenced in csproj or json files (depending how old the discussion is). 当我四处寻找类似的错误时,我看到很多关于csproj或json文件中引用的版本的讨论(取决于讨论的年龄)。 But in .NET Core there is only one reference to Microsoft.AspNetCore.App
. 但在.NET Core中,只有一个对Microsoft.AspNetCore.App
引用。 So, I don't have any way to manipulate the references to either System.Data.SqlClient
or System.Runtime
所以,我没有办法操纵System.Data.SqlClient
或System.Runtime
的引用
Another observation that while most errors refer to real code like connection.Open()
there are two references to non-existent file CSC line 1. 另一个观察结果是,虽然大多数错误引用了像connection.Open()
这样的实际代码,但是对不存在的文件CSC第1行有两个引用。
UPDATE : if I create a new project and copy the offending code there, I am not getting any errors. 更新 :如果我创建一个新项目并在那里复制有问题的代码,我没有收到任何错误。 So, apparently the references to the mismatching versions are somewhere in the project... but I can't figure out where! 所以,显然对不匹配版本的引用是在项目的某个地方...但我无法弄清楚在哪里!
Had the same issue. 有同样的问题。 Resolved by locating RuntimeFrameworkVersion tag in .csproj file and changing it's value to 2.1 . 通过在.csproj文件中找到RuntimeFrameworkVersion标记并将其值更改为2.1来解决此问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.