Enable NuGet Package Restore on Visual Studio 2013

user3180077 picture user3180077 · Oct 11, 2014 · Viewed 65.2k times · Source

I'm following this easy tutorial to start coding with the Google+ API in C#. However, I've been stuck for hours on Step 3, where the first substeps are:

  1. In Visual Studio, click Project > Enable NuGet Package Restore > answer Yes in the dialog.
  2. Right-click on the gplus-quickstart-csharp project and select Manage NuGet Packages.
  3. Click Restore on the Manage NuGet Packages window. This will install the Google API Client libraries.

When I click on Projet, there is no option "Enable NuGet Package Restore".

There is a Manage Nuget Packages option, but no Restore button or option whatsoever.

The project doesn't build and gives me the error:

Error 1 This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is C:\Users\Documents\google+\gplus-quickstart-csharp\.nuget\NuGet.targets. C:\Users\Documents\google+\gplus-quickstart-csharp\gplus-quickstart-csharp\gplus-quickstart-csharp.csproj 201 5 gplus-quickstart-csharp

I went on the microsoft website and it only redirects to the NuGet documentation where I didn't find anything that works. I tried the following commands (described in the examples):

  • D:\projects\contoso> nuget.exe restore
  • D:\projects\contoso> nuget.exe restore contoso.sln
  • D:\projects> nuget.exe restore contoso

but to no avail. And yes, NuGet is installed. Any ideas? Thanks!

Answer

Harald Coppoolse picture Harald Coppoolse · Apr 16, 2015

To find the menu item: "enable nuget package restore" right-click in the solution explorer on the solution - not on the project.

You get a message:

Do you want to configure this solution to download and restore missing NuGet packages during build?

Wasn't that what you were looking for?