5

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?

ProgrimerGuy
  • 63
  • 1
  • 6

2 Answers2

5

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 :)

Community
  • 1
  • 1
AhmadReza Payan
  • 2,171
  • 1
  • 23
  • 33
0

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.

Phil
  • 153
  • 5
  • 15