7
votes

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
3
You can download Nuget.Exe latest versions from nuget.org/downloadsChetan
It's the same with the link I provided yet I tried to downlload and install, and it says 'This extension is already installed to all applicable products'. In which, it is the 3.6.0-rtm-2511. It is not recognized as higher than 3.6.0jace

3 Answers

11
votes

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.

1
votes

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.

0
votes

Try installing the package from Nuget Package Manager (Manage NuGet Packages)and not from console. The package manager will provide you option to update your NUGET application. Look in the 'Visual Studio Gallery' section of the 'Extension and Updates' window that pops up.