We recently added a few dependencies to our project using NuGet. To keep the binaries out of the version control system, I enabled the package restore feature and added the resulting .nuget
folder to the repository. Also the project with the dependencies got the RestorePackages
option set to true
, and an Import
-tag for the nuget.targets
within the .nuget
folder.
So that all works well on my machine with NuGet installed and the package restore feature enabled in my VS settings. However when I want to use this setup to install the dependencies on other machines I run into a few problems.
I was under the impression that one advantage of including the nuget.exe
would allow me to use this on machines that do not necessarily have NuGet installed. However, after reading the article on consent I think the reason it actually fails is that those machines do not have the package restore feature enabled in their settings – obviously as they technically do not even know about NuGet.
What is the preferred way to enable package restore on machines that do not have NuGet installed? Is not having NuGet installed actually a valid option other than for build servers?
Or ideally, is there a way to enable package restore by default from the solution if NuGet isn’t installed itself and as such the setting could not be set by the user? (I actually could think of a setup-script that creates a NuGet.Config
to %AppData&\NuGet
)