NuGet is a package management tool for .NET software. NuGet allows you to use external code sources without including the codebase itself. You can make use of compiled libraries that other developers have already built. You can choose to use a specific version of a package hosted by NuGet, and update that version as need be.
As with MSBuild, we will only scratch the surface of the utility of a .NET package manager. That said, it is still a good idea to get familiar with these tools. As your programs grow larger, MSBuild and NuGet will help to maintain a robust codebase.
NuGet packages are readily available within the IDE itself. Perhaps you have noticed the Dependencies directory that is created in our projects?
To browse available NuGet packages:
- Right-click on that directory
- Select “Manage NuGet Packages” from the dropdown menu
- The resulting window will show you a catalog of software packages you may add to your project
12.2.1. Managing NuGet Packages¶
The following documentation can help you become more familiar with downloading and managing NuGet packages.
Windows Users: Follow this guide.
Mac Users: Use this guide
220.127.116.11. Check Your Understanding¶
Select which item best describes the job of NuGet.
- NuGet compiles your C# programs to be deployed in different conditions.
- NuGet is a marshmallow-like confection found in many candy bars.
- NuGet is a package manager for .NET programs.
- NuGet allows you to download dependency library source code into your solution.
NuGet and MSBuild share responsibilities and only one is needed to deploy a C# app.