[英]Visual Studio Nuget Package Manager Net Core allowing packages that are higher then target sdk
So i have a project targeting Net Core 2.1 (specifically 2.1.500)所以我有一个针对 Net Core 2.1(特别是 2.1.500)的项目
I also have a global.json which also has 2.1.500 in it.我还有一个 global.json,其中也有 2.1.500。
Recently Microsoft updated to Net Core 2.2 but I don't want to move to that yet.最近 Microsoft 更新到 Net Core 2.2,但我还不想转向那个。
When I open Nuget Package Manager it shows me that there are updates available to some pacakges当我打开 Nuget 包管理器时,它向我显示某些包有可用的更新
the problem is that all of these packages are for 2.2 sdk and it completely ignores the fact that I am not targeting that.问题是所有这些包都是针对 2.2 sdk 的,它完全忽略了我没有针对这一点的事实。
This seems like a bug , because in the .Net Framework it would not suggest packages that were targeting an sdk higher than the one you were using.这似乎是一个错误,因为在 .Net Framework 中,它不会建议针对比您使用的更高的 sdk 的软件包。
Is this correct?这样对吗? should I report an issue to the Net Core team?
我应该向 Net Core 团队报告问题吗?
The functionality is correct.功能是正确的。 The libraries target the
.NETStandard2.0
not .NET Core App 2.2
which means any .NET Core
app that is compatible with the .NET Standard 2.0
can use the libraries, regardless of the .NET SDK
they are using.这些库面向
.NETStandard2.0
而不是.NET Core App 2.2
,这意味着与.NET Standard 2.0
兼容的任何.NET Core
应用程序都可以使用这些库,而不管它们使用的是什么.NET SDK
。
For an example, take a look at EntityFramework.SqlServerCompact
in the Manage Nuget Packages
window in Visual Studio.例如,请查看 Visual Studio 的“
Manage Nuget Packages
窗口中的EntityFramework.SqlServerCompact
。 It lists its dependencies as .NETFramework,Version=v4.0
, which means it won't work in .NET Core
or any earlier versions of the .NET Framework
.它将其依赖项列为
.NETFramework,Version=v4.0
,这意味着它不能在.NET Core
或任何早期版本的.NET Framework
。
Additionally, if you try to install the EntityFramework.SqlServerCompact
package in a .NET Core
you will see an error in the Error List window:此外,如果您尝试在
.NET Core
安装EntityFramework.SqlServerCompact
包,您将在“错误列表”窗口中看到错误:
Warning NU1701 Package 'EntityFramework.SqlServerCompact 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'.
警告 NU1701 包“EntityFramework.SqlServerCompact 6.2.0”是使用“.NETFramework,Version=v4.6.1”而不是项目目标框架“.NETCoreApp,Version=v2.1”恢复的。 This package may not be fully compatible with your project.
此包可能与您的项目不完全兼容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.