ProgrimerGuy
ProgrimerGuy

Reputation: 63

"Restore NuGet Packages" in Visual Studios 2015 not doing anything

I pulled my solution from SVN into Visual Studios 2015. I'm getting errors on some of my "using" references within the code, so I am trying to run the "Restore NuGet Packages" option when right clicking the solution in the "Solution Explorer". This does nothing. I have to manually go into nuget manager and uninstall then reinstall the items. Why is this? How can I get "Restore NuGet Packages" to work?

Upvotes: 5

Views: 4483

Answers (2)

Phil
Phil

Reputation: 173

This is what works for me:

  1. Download the project from TFS (or in your case SVN).
  2. Delete the "packages" folder
  3. Make sure the "Package Manager Console" is enabled (Tools -> NuGet Package Manager -> Package Manager Console)
  4. Open the solution file.
  5. At the right side of the "Package Manager Console," a "Restore" button should appear. Click on the "Restore" button.

After following those steps, I no longer get those errors with the "using" references after building.

Hope that helps you.

Edit: If after you complete the above steps you are still getting syntax errors from missing references, right-click on References in the Solution Explorer and then just hit OK. That fixed the problem with the references for me.

Upvotes: 0

AhmadReza Payan
AhmadReza Payan

Reputation: 2271

You might did not enabled automatic package restore from the following section:

Tools >> Options >> Nuget Package Manager >> General settings.

Also you can try this:

Update-Package -Reinstall

This code will forces re-installation in all solution's projects.

Look at the following for more info:

nuget-package-restore-not-working

Migrating MSBuild-Integrated solutions to use Automatic Package Restore

Hope this will help :)

Upvotes: 5

Related Questions