1

I don't understood the overall scheme on how NuGet is used on windows platform (because I never saw this, I work with Linux and monodevelop).
In many windows projects, there is a .nuget folder in repository, like https://github.com/YAFNET/YAFNET/tree/master/yafsrc/.nuget
In this folder there is a nuget.exe executable.

Why it is necessary to add executables to source code control(SCC)?
How NuGet build tool differs from all other binary tools like compilers, which are not included into SCC?
Why other package managers like paludis are not added to SCC, but nuget does?

What are exactly the reasons to put NuGet to SCC?

xsp-server-hater
  • 55
  • 1
  • 1
  • 9

1 Answers1

1

It is not necessary to add NuGet.exe to source control.

The reason some projects have .nuget/NuGet.exe, with a set of other MSBuild files, is to use the MSBuild based package restore. The MSBuild based package restore will run NuGet.exe at build time to download any missing packages.

The MSBuild based package restore has been deprecated by the NuGet team.

Visual Studio with recent versions of the NuGet Package Manager will automatically restore NuGet packages before building the project. If you need to restore NuGet packages on a build server you can use NuGet.exe to restore the NuGet packages by running a command line similar to:

NuGet.exe restore YourSolution.sln
Matt Ward
  • 47,057
  • 5
  • 93
  • 94
  • but why they done so in the older versions of MSVS ? was it too difficult to put nuget into PATH ? – xsp-server-hater Dec 05 '14 at 12:17
  • In older versions of MSVS there was an `Enable NuGet Package Restore` menu option that added the files and at the time the recommendation was to check the entire directory into source control. I guess it was too much extra work to add nuget into the path on the developer's machine separately :) http://docs.nuget.org/docs/Workflows/Using-NuGet-without-committing-packages – Matt Ward Dec 05 '14 at 13:37