Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The package requires NuGet client version '3.6.0' or above

I want to install Microsoft.EntityFrameworkCore and its component. I am using Visual Studio 2015 with NuGet Client version previously 3.5.0 and now I have 3.6.0-rtm-2511 (which is the latest) downloaded from https://www.nuget.org/downloads as instructed by error report. I don't know why issue still persist that I need to have 3.6.0 or higher.

How to update my NuGet Package Manager in other way?
I can't find my Nuget Package Manager for Visual Studio in Update from Tools > Extension and Updates > Updates > Visual Studio Gallery.
I can only see it in Tools > Extension and Updates > Installed but there is no update for it but I noticed that 'Automatically update this extension' is checked.

Result from PM Console

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
like image 566
jace Avatar asked Jul 11 '18 01:07

jace


2 Answers

The package requires NuGet client version '3.6.0' or above

This is a known issue about nuget. NuGet team fixed it for Nuget 4 which comes with VS2017, but 2015 users are left behind.

Ticket: https://github.com/NuGet/Home/issues/6403

Besides, NuGet team will consider a fix. At this time there are no plans to release a new version of NuGet for VS 2015.

So if you want to use the package Microsoft.EntityFrameworkCore.SqlServer 2.1.1, you have to update your Visual Studio 2015 to Visual Studio 2017. Or if the lower version of this package is acceptable to you, you can use the version Microsoft.EntityFrameworkCore.SqlServer 2.0.3

Hope this helps.

like image 159
Leo Liu-MSFT Avatar answered Oct 20 '22 13:10

Leo Liu-MSFT


Edit the files:

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

Change line 3 from:

<metadata minClientVersion="3.6">

to:

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

Now go back to the Package Manager Console and try the install again:

Worked for me.

like image 31
John stone Avatar answered Oct 20 '22 12:10

John stone