Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do nuget package project references get messed up when packages stored locally on a diff folder?

When another developer gets latest from the repository in TFS, the references for each project in the solution don't seem to link up correctly.

From what I assumed, if you use nuget, it will automatically pull the necessary libraries for you no? Do I have to go into vs.net and tell it to download the libraries?

Or did I add something into TFS that I shouldn't have such that it is assuming my packages are stored at a particular path when they might not be when another developer downloads the repository?

This is vs.net 2010.

like image 314
loyalflow Avatar asked Dec 22 '25 17:12

loyalflow


1 Answers

I had some similar issues so I switched NuGet modes to not commit packages to source control.

  1. Got to Options -> Package Manager -> General and check the "Allow NuGet to download missing packeges during build" CheckBox and press "OK".
  2. Right click on the solution in the Visual Studio Solution Explorer and select "Enable NuGet Package Restore".

I also added the contents of the .nuget and packages folders (which the previous steps created in the solution's folder) to the solution in solution folders. This way I can right click on the solution and select "Check In..." and all relevant files will be checked in. If you do this then it is very important that none of the package files (like .dll files) are included in the solution or TFS as this will cause NuGet to not work correctly. If you choose not to do this then you will need to check in your changes using the Pending Changes window or by right clicking on the solution folder in Source Control Explorer and selecting "Check In Pending Changes..."

My .nuget solution folder contains the following files:

  • Notes.txt describing how I set NuGet up, why I set it up the way I did, and any usage notes/issues.
  • NuGet.config
  • NuGet.exe
  • NuGet.targets

My packages solution folder contains the following files:

  • repositories.config
like image 128
Trisped Avatar answered Dec 24 '25 05:12

Trisped