Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Enable NuGet Package Restore disappears, missing

I have two projects ones a class library and ones an mvc3 project. They both have nuget packages associated with them. On the class library when I right click the solution I get the "Enable NuGet Packges Restore" option

enter image description here

In the MVC one I do not.

enter image description here

needless to say I would like the feature for both projects. what am I doing wrong?

like image 765
Raif Avatar asked Mar 15 '13 14:03

Raif


People also ask

Was not found it might have been deleted since NuGet restore?

It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Here are some actions you can take to resolve this error: Add the /restore option to your MSBuild.exe command.

How do I force a NuGet package to reinstall?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I fix NuGet recovery failed?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.


2 Answers

The NuGet package restore context menu item is hidden when the extension detects the presence of a $(SolutionDir).nuget folder containing the nuget.exe, nuget.config and nuget.targets needed to perform package restore.

The MVC app already has these, so restore should be enabled. If not, simply delete the .nuget folder and you'll see the menu item reappear.

like image 100
Xavier Decoster Avatar answered Oct 22 '22 21:10

Xavier Decoster


For me it was as simple as:

"Manage NuGet Packages for Solution" -> "Restore" (top right of dialog)

like image 32
Kinetic Avatar answered Oct 22 '22 23:10

Kinetic