Visual Studio doesn't load project references

I also had this problem and it took me some time to figure it out. The problem is that NuGet changed how the packages are restored. The "old way" needed the ".nuget" folder with 3 files (nuget.config, nuget.exe, nuget.targets) and some settings in the project file like:

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>

This caused the project to be broken.

To fix this, copy the missing directory to the project (get it with an older version of Visual Studio/NuGet or from a co-worker who has it) or just simply delete the aforementioned part from the project file.

For best results, also remove:

<RestorePackages>true</RestorePackages> 

and

<Import Project="$(SolutionDir)\.nuget\nuget.targets" />

from the project file!


Find more on the subject here:

http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

http://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore

https://docs.microsoft.com/en-us/visualstudio/ide/troubleshooting-broken-references