So, my situation specifically was I downloaded the source code for the actual Nuget site (to create an internal implementation of Nuget in my company), and when I tried to deploy it, that's when I got the error above.
What I had to do was:
- Delete the .nuget folder.
- Within your file system (not via Visual Studio), modify the .csproj files (delete where it said
<packageRestore>true</packageRestore>
, as well as where it imported the project that had nuget.targets in the line - just do a "find" for "nuget.targets", and delete all lines that have animport
. - Save your .csproj file changes.
- Check in your changes into TFS.
- Deploy your solution.