[Visual Studio] NUGET the Magician

When you use Visual Studio to write code, sooner or later you will need to add third-party libraries. The old way was to go on Google (or Bing), search for the library, download it and add it to the Project by hand. From now on, you don’t have to do that anymore.

nuget

Nuget is a tool that helps you add external libraries to your Project. Using Nuget is very simple and easy

1. Preparation

Change your DNS to Google DNS

For some reason I can’t figure out, with the default DNS I could not reach Nuget

2. Updating the Nuget Package

Open Visual Studio, pick Tool > Extension and Update

Go to the Update section and update everything you can. If you have never updated before, chances are you will see the Nuget Package entry among the update packages

3. Usage

Open any Project — here I’ll pick Windows Phone, with the RSS Reader sample Project

Open Solution Explorer, right click on References > Manage Nuget Package

Pick the Online section

From here you can see plenty of nice packages for your app

If your app uses Json, you can install Json.NET

The right-hand column holds the information about the currently selected Nuget package. Many Nuget packages even include usage information.

You can go to https://www.nuget.org to learn more or to find the right nuget packages faster

3.1. Installing a Nuget package

Type what you are looking for into the Search box

Pick the right Nuget package on the left, hit Install

Wait a moment for it to install. You will always get the newest Nuget package that fits your project. If your Project isn’t compatible, the Nuget Package Manager automatically removes it from the Project

That’s it — you can start using that Nuget package right away

4. A few nice Nuget packages

  • Json.NET: for working with Json data
  • HtmlAgilityPack: for working with HTML data