簡體   English   中英

該包需要 NuGet 客戶端版本“3.6.0”或更高版本

[英]The package requires NuGet client version '3.6.0' or above

我想安裝 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 客戶端版本“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

希望這可以幫助。

嘗試從 Nuget 包管理器(管理 NuGet 包)而不是從控制台安裝包。 包管理器將為您提供更新 NUGET 應用程序的選項。 查看彈出的“擴展和更新”窗口的“Visual Studio 庫”部分。

編輯文件:

  • %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">

現在返回包管理器控制台並再次嘗試安裝:

為我工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM