Restore packages from source control

Mar 23, 2012 at 1:25 PM

I would like to avoid checking in packages and there contents into source control twice.

I have had a look at using NuGet without committing packages to source control and quite like the workflow of restoring the packages before build. But I do not want to have to rely on external sources in order to compile my code.

Is it possible to use the restore workflow but using checked in packages as the source of the restore? I could not find any information on setting this up.

Mar 26, 2012 at 10:57 PM

When you enable package restore mode, nuget install a .targets file which all projects reference. This .targets file contains the tasks that do the actual restoration of packages.

There is a property in this .targets file which specify where to look for packages.

        <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
        <PackageSources>""</PackageSources>
You can add your own local package source to this list.