c# - 该软件包需要 NuGet 客户端版本 '3.6.0' 或更高版本

标签 c# visual-studio nuget

我想安装 Microsoft.EntityFrameworkCore 及其组件。我正在使用 Visual Studio 2015 和之前版本为 3.5.0 的 NuGet 客户端,现在我从 https://www.nuget.org/downloads 下载了 3.6.0-rtm-2511(最新版本)。按照错误报告的指示。我不知道为什么问题仍然存在,我需要 3.6.0 或更高版本。

如何以其他方式更新我的 NuGet 包管理器?
我在“工具”>“扩展和更新”>“更新”>“Visual Studio 库”的“更新”中找不到 Visual Studio 的 Nuget 包管理器。
我只能在“工具”>“扩展和更新”>“已安装”中看到它,但没有更新,但我注意到选中了“自动更新此扩展”。

PM 控制台结果

PM> install-package microsoft.entityframeworkcore.sqlserver  
  GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.entityframeworkcore.sqlserver/index.json  
  OK https://api.nuget.org/v3/registration3-gz-semver2/microsoft.entityframeworkcore.sqlserver/index.json 329ms  
Retrieving package 'Microsoft.EntityFrameworkCore.SqlServer 2.1.1' from 'nuget.org'.  
Install failed. Rolling back...  
Uninstalling NuGet package Microsoft.EntityFrameworkCore.SqlServer.2.1.1.  
Executing nuget actions took 162.34 ms  
install-package : The 'Microsoft.EntityFrameworkCore.SqlServer 2.1.1' package requires NuGet client version '3.6.0' or above, but the current NuGet 
version is '3.6.0-rtm-2511'. To upgrade NuGet, please go to http://docs.nuget.org/consume/installing-nuget  
At line:1 char:1  
+ install-package microsoft.entityframeworkcore.sqlserver  
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception  
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:33.0573364

最佳答案

The package requires NuGet client version '3.6.0' or above

这是有关 nuget 的已知问题。 NuGet 团队针对 VS2017 附带的 Nuget 4 修复了该问题,但 2015 年的用户被抛在了后面。

机票:https://github.com/NuGet/Home/issues/6403

此外,NuGet 团队将考虑修复。目前没有计划发布适用于 VS 2015 的新版本 NuGet。

因此,如果您想使用包 Microsoft.EntityFrameworkCore.SqlServer 2.1.1,您必须将 Visual Studio 2015 更新为 Visual Studio 2017。或者如果可以接受此包的较低版本对您来说,您可以使用版本 Microsoft.EntityFrameworkCore.SqlServer 2.0.3

希望这有帮助。

关于c# - 该软件包需要 NuGet 客户端版本 '3.6.0' 或更高版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51275984/

相关文章:

c# - 一个参数的多个构造函数

c++ - Visual Studio - 并行化构建不会提高性能

visual-studio - Visual Studio 项目中的图标是什么意思?

c# - Nuget 安装 System.Data.Sqlite 时出现脚本错误

nuget - 如何使用 MSBuild 任务和目标文件创建 NuGet 包

c# - 如何创建一个通用方法,可以将 value 变量初始化为 0 或将 ref 变量初始化为 new (不为 null)

c# - 使用 Entity Framework (EF) 在存储库中分页实体(聚合)

c# - 将属性子对象移动到根

visual-studio - 为什么在 Visual Studio 2012/2013 中增量搜索非常缓慢?

msbuild - VS2017中的新项目可以将nuget包存储在项目包目录中吗?