【问题标题】:The package requires NuGet client version '3.6.0' or above该软件包需要 NuGet 客户端版本“3.6.0”或更高版本
【发布时间】:2018-07-11 01:28:05
【问题描述】:

我想安装 Microsoft.EntityFrameworkCore 及其组件。我正在使用 Visual Studio 2015 和 NuGet 客户端版本以前 3.5.0,现在我按照错误报告的指示从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

【问题讨论】:

  • 您可以从nuget.org/downloads下载Nuget.Exe最新版本
  • 与我提供的链接相同,但我尝试下载并安装,它显示“此扩展已安装到所有适用产品”。其中,它是 3.6.0-rtm-2511。不识别为高于 3.6.0

标签: c# visual-studio nuget


【解决方案1】:

该包需要 NuGet 客户端版本 '3.6.0' 或更高版本

这是一个关于 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

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    编辑文件:

    • %userprofile%\.nuget\packages\microsoft.entityframeworkcore\3.1.8\microsoft.entityframeworkcore.nuspec
    • %userprofile%\.nuget\packages\microsoft.entityframeworkcore.abstractions\3.1.8\microsoft.entityframeworkcore.abstractions.nuspec
    • %userprofile%\.nuget\packages\microsoft.entityframeworkcore.analyzers\3.1.8\microsoft.entityframeworkcore.analyzers.nuspec
    • %userprofile%\.nuget\packages\microsoft.entityframeworkcore.relational\3.1.8\microsoft.entityframeworkcore.relational.nuspec
    • %userprofile%\.nuget\packages\microsoft.entityframeworkcore.tools\3.1.8\microsoft.entityframeworkcore.tools.nuspec

    将第 3 行更改为:

    <metadata minClientVersion="3.6">

    到:

    <metadata minClientVersion="3.6.0-rtm-2511">

    现在返回包管理器控制台并再次尝试安装:

    为我工作。

    【讨论】:

      【解决方案3】:

      尝试从 Nuget 包管理器(管理 NuGet 包)而不是从控制台安装包。包管理器将为您提供更新 NUGET 应用程序的选项。查看弹出的“扩展和更新”窗口的“Visual Studio 库”部分。

      【讨论】:

      • 这不行,我的版本目前是3.4,显示没有可用的更新。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-29
      • 2015-05-27
      • 1970-01-01
      • 2010-10-01
      相关资源
      最近更新 更多