How do I disable restoring NuGet packages while starting the solution

13,020

The restore you are seeing there is Auto-Restore which will only run on SDK based projects. https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#automatic-restore-in-visual-studio

There is currently no way to disable auto-restore explicitly but you can disable restore itself. Note that this will disable all restore (on build/rebuild & solution right click restore)

https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#enabling-and-disabling-package-restore

Go to Tools -> Options -> NuGet Package Manager -> General -> Package Restore. The first option disables restore itself, while the 2nd option disables on build restore.

NuGet tries to restore to make sure that the packages were not deleted from disk or that the assets file (which helps the intellisense) is not deleted. This is integral to the complete visual studio experience. There are improvements in 15.3 (to be released within 2 weeks) that would improve the restore experience on start-up if restore was done at some point previously and if there are no changes to the package references, source etc.

Share:
13,020
Portikus
Author by

Portikus

Updated on June 21, 2022

Comments

  • Portikus
    Portikus about 2 years

    every time I start my solution (65 projects, UWP, WPF, NetStandard) I can see in my output window (Package Manager) that NuGet is restoring packages. This task needs about 26 seconds. I wonder if this is necessary because why should I want to restore the packages every time I start the solution? It would be great if I could disable it.

    I am using Visual Studio 15.2 (26430.16)

    Thank you for your help!