Chapter 10NuGet

—by Phil Haack and Jon Galloway

What's In This Chapter?

  • NuGet Basics
  • How to add a library as a package
  • How to create packages
  • How to publish packages


You can find the code downloads for this chapter at on the Download Code tab. The code for this chapter is contained in the following file:

NuGet is a package-management system for .NET and Visual Studio that makes it easy to add, update, and remove external libraries and their dependencies in your application. NuGet also makes creating packages that you can share with the world easy. This chapter covers the basics of how to use NuGet in your application development workflow, and looks at some more advanced uses of NuGet.


Try as it might, Microsoft cannot provide every possible piece of code a developer could need. Millions of developers are on the .NET platform, each with unique problems to solve. Waiting on Microsoft to solve every problem isn't efficient and doesn't make sense.

The good news is that many developers don't wait around to “scratch their own itch.” They solve their own problems (and those of their peers) with useful libraries that they write and then distribute on the Web.

Three big challenges with all these libraries out there in the wild are discovery, installation, and maintenance. How do developers find a library in the first place? After they find it, how do they ...

Get Professional ASP.NET MVC 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.