What is NUGET - a Brief Introduction
NuGet:
NuGet (NuPack) is a free open source developer
focused package manager intent on simplifying the process of incorporating
third party libraries into a .NET application during development.
NuGet is Helpful. WHEN?
If you're a .NET programmer, you've likely experienced the pain of getting a
3rd party library into your project. It usually goes something like this:
- You know what it's called,
but you have no idea where it lives, so you search for it in your favorite
engine. You often find multiple pages that could legitimately be the
want you want.
- You look around the main page
for a link to the download page.
- Once on the download page,
you're often presented with way more choices than you'd like: several
builds, for several platforms.
- You download a zip file that
you then unzip somewhere on your machine (after remembering to 'unblock'
it in Windows!).
- You copy the relevant
assemblies into some folder in your solution.
- In VS, you add a reference to
the assemblies.
- In some cases, you need to
make changes to your web.config file to properly enable the
component. This is quite non-trivial if you're not familiar with it.
Sure, once you're familiar with a library, you'd probably just copy it from
another project instead of getting it from the web, which makes things a bit
easier. But it's still an overall very tedious process.
And that doesn't even cover the common case where a library has a dependency
on some other libraries, which raises the complexity to the next level.
With NuGet, you get a PowerShell window directly in Visual Studio. You
just type a simple command like 'Add-Package CoolLibrary', and it takes care of
everything. You can also right click on References and choose 'Add
Package Reference' to do the same thing through a dialog. It's all very
very easy, and it just works!