Nuget fails to manage references in a project cloned from git

I created a project (asp mvc 4) and used nuget to add dlls to it. Than I committed it to bitbucket and finally cloned to a different directory on the same PC. In the cloned project every single reference shows an error (yellow exclamation mark)

enter image description here

I allowed nuget to manage packages:

enter image description here

I also have nuget files in my solution:

enter image description here

Right after cloning there’s no ‘packages’ folder in my solution, but after first attempt to build it appears and if filled with dlls. My .gitignore:


How do I make it work?


Build output (btw the build took a few minutes and after it failed the whole VS froze – I couldn’t even copy the error messages) :

When I right-click on any of the references and go to properties the ‘Path’ is empty.

enter image description here

my .csproj:

<Reference Include="Microsoft.Web.Infrastructure, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

this file actually exists in the given location.

  • Git best-practices with Visual Studio projects
  • How to prevent “There appears to be a discrepancy between the solution's source control…” without changing the .sln file
  • Migrating an SVN repository to some distributed VCS (Git or Mercurial)
  • Best practice with .gitignore for connection strings inside App.config or Web.config
  • Changing one character in a file leads to MSysGit thinking the whole file has changed
  • Use Git list output to copy files for archiving
  • How to change SVN authentication details in AnkhSVN in Visual Studio 2010?
  • One Solution collect form web for “Nuget fails to manage references in a project cloned from git”

    It looks like everything is functioning as it should. (Do you see any errors other than the yellow exclamation icon?) The only thing that’s weird is the remaining yellow icons. This is most likely just a refresh issue. Either push refresh at the top of the solution window (the two arrows), or close and reopen the solution. You’ll find the yellow exclamation points are gone, and all is well.

    Alternatively, commit the packages folder and remove the line in .gitignore, though I grant you’ve previously chosen not to do this.


    Another thought: you could get this experience if you opened up the solution on a machine that didn’t have .net 4.5 or mvc 4 installed.

    Git Baby is a git and github fan, let's start git clone.