Introduction to NuGet

Try as it might, Microsoft cannot provide every possible piece of code a developer could need. There are millions of developers on the .NET platform, each with unique problems to solve. It doesn't scale or make sense to wait on Microsoft to solve every problem.

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? Once they find it, how do they make use of it in their projects? And once they've installed it, how do they track project updates?

This section walks through a quick example of the steps necessary to install ELMAH without the benefit of NuGet. ELMAH stands for Error Logging Module and Handler and is used to log and display unhandled exception information within a web application. The steps are especially familiar to the NuGet team because we use ELMAH in the NuGet.org site, which is discussed in Chapter 16.

These are the steps it takes to make use of the library:

1. Find ELMAH. Due to its unique name, this is easy with any search engine.
2. Download the correct zip package. Multiple zip files are presented and, as I personally learned, choosing the correct one isn't always trivial.
3. “Unblock” the package. Files downloaded ...

Get Professional ASP.NET MVC 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.