Publishing NuGet packages to the official package source is not always optimal or feasible, specifically when working with large packages (e.g. containing databases) and/or proprietary code solely intended for use within your company. Examples are based on Visual Studio 2010 and NuGet 1.7.
Creating a local package source (or “package repository” if you will) is an easy way to manage and share code not intended for public use, while benefiting from NuGet’s inherent version and dependency management.
Creating a package source can be done in several ways:
- Place packages in a local folder
- Place packages in a network folder
- Host packages in a web server
Since most companies have shared network drives in place option 2 is very viable and extremely simple to setup, as shown in the following.
- Install the NuGet Visual Studio extension
- Open the NuGet settings (Tools → Library Package Manager → Package Manager Settings).
- Add a new package source by entering a name (e.g. “Company proprietary packages”) and choosing whatever location the packages are at.
That’s it! The new package source is now available in the “Manage NuGet Packages” dialog: