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)
- git source control not working with visual studio
- How to quickly switch source control providers in Visual Studio 2010?
- Visual Studio (Microsoft ) Symbol server with git
- Is ClearCase supported in Visual Studio 2010
- How to add an existing solution to a Team Foundation Server?
- Show list of tasks to asssociate when commiting to a git repository from Visual Studio 2008-2013
I allowed nuget to manage packages:
I also have nuget files in my solution:
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.
<Reference Include="Microsoft.Web.Infrastructure, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Private>True</Private> <HintPath>..\packages\Microsoft.Web.Infrastructure.22.214.171.124\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> </Reference>
this file actually exists in the given location.
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 asp.net mvc 4 installed.