11

Closed

Make package restore the default for new solutions

description

The success of NuGet has caused a shift in the way most solutions are created. After creating the solution, it's important to remember to "Enable NuGet Package Restore" - while it's not a difficult task, it is an extra step.

NuGet should enable package restore by default for new solutions. To support the less common situation where package restore is not preferred, NuGet should provide an ability to remove from the solution package restore (ideally as a context menu item on the solution).
Closed Jul 31, 2013 at 11:41 PM by deepakverma
Verified:

Scenarios verified:
  • Start with a New project ( no packages folder) created with 2.7 and then enable package restore
    ○ Install package
    ○ Check-in to TFS (packages folder should not be added)
    ○ Checkout from TFS on a different machine or in a different folder (no packages folder exists)
    ○ Build should restore packages
    ○ Add another project to the solution, install packages
    ○ Verify this new project is now included in the restore process.
    ○ Enable package restore
    ○ Check it in
    ○ Check it out on same machine in different folder
    ○ Verify packages are getting restored using nuget.exe
  • Start with a project with package restore enabled in 2.7 and move it to use VSEventpackage
    ○ Create new project
    ○ Install packages
    ○ Enable package restore (enable in nuget.targets to download nuget.exe)
    ○ Check in (exclude nuget.exe from the checkin)
    ○ Check out on a CI machine and verify packages are restored correctly
    ○ Checkout on a Dev machine and verify packages are restored correctly
    ○ Delete .nuget folder, remove imports from project
    ○ Check it out in a separate folder or on a different machine
    ○ Verify it builds and restore packages using VSEventPackage
  • Start with an existing project created in 2.6 checked in to TFS with no package restore (with packages folder) and move it to 2.7 and back to 2.6
    ○ Packages folder already exist in TFS , the project was created in 2.6
    ○ Verify it builds fine in 2.7
    ○ In 2.7 install a package and check it in
    ○ In 2.6 check it out and verify it builds fine
  • Start with a new project created in 2.7 (no package restore) and then move it to 2.6 and then back
Other test points:
  • Consent check testing, will come in later after we have implemented the consent to be on by default feature
  • Check for Package restore perf impact if any, each time user builds the solution? Large solution with ~ 30 packages in each project.
    ○ Does it get called on background build for intellisense etc
  • Verify on different SKU's and project types to make sure the new VSEventspackage works seamlessly
    ○ SKU's: WDX , Win Phone, VWD, Win 8 express, VSU.

○ Interesting project types : F#, windows store, C++

  • Verify output and error messages
  • Negative conditions
    ○ Feed not available
    ○ Partially restored package
    ○ Test that packages are restored for projects which cannot be loaded because of missing targets file in packages.
    ○ Verify that it actually restored the content correctly
    ○ Verify for a package installed from myget feed is restored correctly.
  • Possibility of running functional tests for this features on different sku's and projects.

comments

erichexter wrote Jun 5, 2013 at 4:41 PM

you need to do this.. its just the right thing to do.

dotnetjunky wrote Jun 5, 2013 at 4:56 PM

Indeed, we are working on this. See the schedule on the home page: https://nuget.codeplex.com/

mhinze wrote Jun 5, 2013 at 5:36 PM

That's great news - I browsed the lists but couldn't see a similar issue/work item linked to a release though. If you get a minute to point me to the issue, I would like to review it.

garyhowlett wrote Aug 1, 2013 at 8:32 AM

Will it be possible to turn this option off again via nuget.config?

We already have another mechanism to enable package restore.

Thanks

Gary

dotnetjunky wrote Aug 1, 2013 at 10:25 AM

Yes, you will be able to turn it off. You can go to the Options page for Package Manager and uncheck the box "Allow restoring packages during build..."