NuGet - mcbride-clint/DeveloperCurriculum GitHub Wiki

NuGet is a package manager, created by Microsoft, to to allow developers to create, share, and use code. The code is distributed as packages of compiled DLLs and metadata about the code. The packages are .nupkg files, basically named .zip files. When installing a package, NuGet will automatically add the references to the libraries and also will download and reference any packages that the original package references.

NuGet.org is the largest public repository of packages that anyone can get a Microsoft account and begin uploading their own packages. There are also tools to host your own private repositories or Visual Studio can read .nupkg files right off a File System. Azure DevOps also has the ability to host packages for your Organization.

Creating a package

Creating a .nupkg used to be much more difficult with creating the xml manifest by hand and various command line actions though MsBuild or nuget.exe but in recent years Microsoft has added functionality into it's project files and dotnet.exe. Any .Net Standard, .Net 5+ and .Net Core library project will automatically create a .nupkg when built with the create package flag set or by calling dotnet pack against the project.

Adding a Package via Visual Studio

TODO with pictures

See Also