Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
573 views
in Technique[技术] by (71.8m points)

c# - Enable NuGet Package Restore on Visual Studio 2013

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:UsersDocumentsgoogle+gplus-quickstart-csharp.nugetNuGet.targets. C:UsersDocumentsgoogle+gplus-quickstart-csharpgplus-quickstart-csharpgplus-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:projectscontoso> nuget.exe restore
  • D:projectscontoso> nuget.exe restore contoso.sln
  • D:projects> nuget.exe restore contoso

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...