How to upgrade NuGet with Visual Studio 2017?

前端 未结 1 1661
无人及你
无人及你 2021-01-22 11:08

I\'m getting a build error that I need to upgrade NuGet:

The \'Microsoft.NETCore.Platforms 1.1.0\' package requires NuGet client version \'2.12\' or abo

相关标签:
1条回答
  • 2021-01-22 11:49

    How to Upgrade NuGet with Visual Studio 2017

    That because you have a .nuget folder at solution level, that folder contains an old (2.8.x) nuget.exe file. A lot of packages might need new version of that file. You should update it:

    1. Open this link: https://www.nuget.org/downloads, switch to the Windows x86 Commandline tab, download 3.3 or above.
    2. Download latest version of nuget.exe
    3. Replace your .nuget/nuget.exe with this new version.

    And try again.

    Besides, your solution is using an old nuget restore method that has been deprecated. Automatic Package Restore is the NuGet team's recommended approach to Package Restore within Visual Studio, and it was introduced in NuGet 2.7. Beginning with NuGet 2.7, the NuGet Visual Studio extension integrates into Visual Studio's build events and restores missing packages when a build begins.

    See this thread NuGet auto package restore does not work with MSBuild and Nuget: Switching from "Enable Package Restore" to "Automatic Package Restore" for some more details.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题