简体   繁体   English

Visual Studio Nuget 包管理器 Net Core 允许高于目标 sdk 的包

[英]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.

相关问题 使用.NET CORE安装NuGet软件包和Visual Studio代码失败 - Install NuGet package with .NET CORE and visual studio code failed Visual Studio 2017仅具有适用于.NET Core 2.x的脱机Nuget包。如何获得在线套餐? - Visual Studio 2017 only has offline Nuget Packages for .NET Core 2.x. How to get online packages? 引用 a.Net Core 3.1 NuGet package 的 a.Net 5 Visual Studio 项目/解决方案如何编译成功? - How can a .Net 5 Visual Studio Project / Solution that reference a .Net Core 3.1 NuGet package compile successfuly? 从visual studio命令提示符运行nuget包管理器控制台 - Run nuget package manager console from visual studio command prompt 在Visual Studio外部重新安装ASP.NET网站的NuGet包 - Reinstall NuGet packages for ASP.NET Website outside Visual Studio .NET Visual Studio 中的 6 个项目提供更新 NuGet 包到 7.0.0 - .NET 6 project in Visual Studio offers update NuGet packages to 7.0.0 Visual Studio中缺少Nuget软件包 - Nuget Packages are missing in Visual Studio 如何从visual studio 2003中瞄准更高的.net框架 - How to target higher .net framework from visual studio 2003 如何使用NuGet软件包管理器控制台在Visual Studio 2012 Pro上安装OpenPop.NET? - How can i install OpenPop.NET on my visual studio 2012 pro using the NuGet package manager console? .NET Core SDK / 运行时和 NuGet Z209802FB858E2C83205027DBBB5D9E6C 版本是否匹配? - Do .NET Core SDK / Runtime and NuGet Package Versions have to match?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM