Process of Installing the Nuget Package Manager in ASP.NET Web API

Introduction

In this article we will define what the NuGet Package Manager is and how to installed it in the ASP.NET Web API.

What the NuGet Package Manager Is

The NuGet Package Manager is a Visual Studio extension that helps add, remove and update the libraries of ASP.NET projects. The NuGet Package Manager is for the Microsoft Visual Studio development platform that includes the  .Net framework. When we install the NuGet package manager it can copy the files and perform the changes that are required.

These changes are automatically performed by the NuGet package manager at the time of installation. The changes performed include addition of references and modifying the web.config and app.config.

How the NuGet Package Manager Works

The NuGet Package Manager includes the files of a project to copy and creates a manifest file that describes the contents of the package. And determines what  libraries needs to be added and removed. Packages are bundled into feeds that are accessed by Visual Studio for the presentation of a list of available packages.

The NuGet Package Manager dialog box loooks like:

nu2.jpg

How to install the NuGet Package Manager

First we create the MVC4 Web API application.

  • Start the Visual Studio 2010
  • Click on "New Project" from the Start Page.
  • In the New Project window choose "ASP.NET MVC4 Web Application" and click on the "OK" button.
nu.jpg

  • Now open a New ASP.NET MVC4 Project template.
nu1.jpg
  • We choose Web API and click on the "OK" button.

Now we describe the process of installing the NuGet Package Manager.

 First we determine whether it is already installed. For checking it we select:

  • Go to Tools.
  • "Library Package Manager" -> "Manage NuGet Packages for Solution".

If the NuGet Packages for Solution is not shown in the tools menu then that confirms that the NuGet package is not installed.

nug.jpg

For installing we select:

  • Go to "Tools"
  • "Tools" -> "Extension Manager"

The dialog box shows like this:

nug1.jpg

Now we click on "Download" and install it.

After installation the dialog box looks like this:

nu4.jpg

Now we again determine whether the NuGet Package Manager is installed.

  • Again go to "Tools"
  • Select "Library Package Manager" -> "Manage NuGet Packages for Solution"

If the "Manage NuGet Packages for Solution" is visible then that confirms that the NuGet Package Manager is installed.

nug5.jpg