Question

I have a Visual Studio project which I have committed to VisualSVN (via the VisualSVN => Commit menu in Visual Studio). I have added a number of libraries to this project via NuGet.

My colleague has downloaded the project I have uploaded to SVN (via VisualSVN => Get solution from Subversion...) and has found that these libraries are missing, and he is having to re-download them.

A few questions:

  1. Is this by design? Or have I not committed my Solution properly? Or has my colleague not download the solution to his machine properly?
  2. If this is by design, what is the correct way to re-add references to a solution downloaded from an SVN server? I am worried that I may have added a reference and worked with it, and that it may have been updated since so whenever my colleague re-adds the same reference via NuGet he will get a more up to date version that will be different, and this will break my program. Is this a valid concern?
Était-ce utile?

La solution

Yes, this is by design. The whole concept of using Nuget is that you will not have to keep libraries in your version control system.

You need to Right Click on your solution in Visual Studio and select Enable NuGet Package Restore.

This will configure the solution to restore the NuGet packages (if any missing, or in case of none) whenever you'll do a build. Also, all the libraries that you've added for a particular project will have an entry in the packages.config created in the project's source drectory; for eg:

<packages>
  <package id="jQuery" version="1.8.3" />
</packages>

This way NuGet makes sure everybody gets the same version.

Autres conseils

Just enable "Nuget package restore" in your solution and packages will be automatically downloaded during the build: http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top