NuGet Package Restore seems to be the correct way to combine NuGet with source-control (in my case TFS), for example in this answer and in the first comment to this closed question. NuGet Package Restore allows a solution fetched from source-control and built on another dev’ machine to automatically fetch the required NuGet packages.
To add NuGet Package Restore to a solution you right click on the solution and then select Enable NuGet Package Restore. That “added a solution folder named .nuget containing NuGet.exe and a NuGet.targets MsBuild file. It also changed every project in the solution to import the NuGet.targets MsBuild task.” (Quote from http://docs.nuget.org/docs/Workflows/Using-NuGet-without-committing-packages). But some of the projects in the solution I am working on are utility projects, shared between different solutions and between different developers and they do not require references handled by NuGet.
How do I enable NuGet Package Restore but preclude certain projects in the solution from the NuGet build task set-up?
At the moment, NuGet Package Restore has some limitations and can’t be restricted to specific projects.
There’s an existing NuGet work item that would make this possible :
#1812 – Enable Package Restore – Selective Projects
Please comment/vote on it to bump the priority since it’s currently backlogged.
Note: at the surface, .csproj files appears to have a property to support turning off NuGet Package Restore, but due to another issue, it keeps turning back on : NuGet command line forces package restore