NuGet

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:

  1. Right-click on that directory
  2. Select “Manage NuGet Packages” from the dropdown menu
  3. The resulting window will show you a catalog of software packages you may add to your project

Managing NuGet Packages

The following documentation can help you become more familiar with downloading and managing NuGet packages.

<strong>Windows Users: Follow this guide.</strong> .

<strong>Mac Users: Follow this guide.</strong> .

Check Your Understanding

Question

Select which item best describes the job of NuGet.

  1. NuGet compiles your C# programs to be deployed in different conditions.
  2. NuGet is a marshmallow-like confection found in many candy bars.
  3. NuGet is a package manager for .NET programs.
  4. NuGet allows you to download dependency library source code into your solution.
Question

True or False: NuGet and MSBuild share responsibilities and only one is needed to deploy a C# app.