Local NuGet package feeds are simply hierarchical folder structures on your local network (or even just your own computer) in which you place packages. These feeds can then be used as package sources with all other NuGet operations using the CLI, the Package Manager UI, and the Package Manager Console.
Hierarchical folder structures are supported in NuGet 3.3+. Older versions of NuGet use only a single folder containing packages, with which performance is much lower than the hierarchical structure.
Initializing and maintaining hierarchical folders
The hierarchical versioned folder tree has the following general structure:
\\myserver\packages └─<packageID> └─<version> ├─<packageID>.<version>.nupkg └─<other files>
NuGet creates this structure automatically when you use the
nuget add command to copy a package to the feed:
nuget add new_package.1.0.0.nupkg -source \\myserver\packages
nuget add command works with one package at a time, which can be inconvenient when setting up a feed with multiple packages.
In such cases, use the
nuget init command to copy all packages in a folder to the feed as if you ran
nuget add on each one individually. For example, the following command copies all packages from
c:\packages to a hierarchical tree on
nuget init c:\packages \\myserver\packages
As with the
init creates a folder for each package identifier, each of which contains a version number folder, within which is the appropriate package.
Send feedback about: