1

I just built a new PC, installed my dev tools, connected to TFS and downloaded my project. Now most of my references are broken to EF, jQuery, etc.

The packages folder is missing all the .dlls, if I try to use NuGet restore nothing happens. If I use NuGet manager for Solution there is no "force" reinstall option.

NuGet seems to be more a hindrance than a help.

user3953989
  • 1,844
  • 3
  • 25
  • 56
  • First, you need to create a new local project installing NuGet packages to confirm whether the NuGet Package Manager can work correctly. Then please check the output window when restore packages, whether there has any error message in Output window. Please share the message here. – Weiwei Aug 26 '16 at 03:23
  • **See Also**: [NuGet has problems with missing packages, how to restore?](https://stackoverflow.com/q/38074578/1366033) – KyleMit Sep 16 '20 at 19:36

2 Answers2

5

You can run "Update-Package -reinstall" command from Package Manager Console in VS to force reinstall all the packages.

Package authors often need to reinstall the same version of package they are developing to test the behavior. The command Install-Package does not provide ‘-force’ option, that could forcefully reinstall a package. So, Update-Package -reinstall is added to meet that requirement.

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
1

I've had that same issue plenty of times when I need to re-download code after getting a new PC. Here's what worked 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.

Hope that helps you.

I'm not sure if I'm supposed to share the link if I already answered a similar question or just answer again, so I'm doing both. Here's the link to the same answer from a different asker.

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