Private NuGet Packages

Tom Chizek
6 min readJul 27, 2020
Photo by Andrea Piacquadio from Pexels

Introduction and Definitions

What do I mean by private NuGet Packages? I mean, a package that you manage using the standard NuGet tools hosted on a local machine or server. This category of package goes from something that a single developer uses to simplify the management of the libraries that they use for individual development — up to major corporations that have dedicated teams that maintain corporate standard libraries that every software team must include in their projects. Between these extremes is an entire spectrum of uses for this tool. I will cover how to create and use these packages and what some ways I have found them to be useful. As an additional note, for people who are interested in sharing their work with other developers working out the issues as a private package is advised before you publish it to the public NuGet site.

Photo by Canva Studio from Pexels

Setting up your project as a Package

There are some minimum steps that you need to do to have a project work as a NuGet package. First, it must be a library of some sort, I have only done this with class libraries for .Net Framework, .Net Core, and .Net Standard, but there doesn’t seem to be anything in this process that is unique to class libraries. I am going to use the library that I introduced during my previous articles. You do not need to have read the earlier articles. Using this library is just a handy example. The step that makes everything begin to work is setting the project to be a NuGet package. You do that in the properties on the Package tab. Which looks like:

The minimum step for a purely personal package that you are never planning on sharing with anyone else is to check the “Generate NuGet package on build” option, and pay attention to the package version. Visual Studio will fill in default values for the values that must have some value when you create the project. These values are mostly useless for real use of the package, but if you are the only person using it, then they…