.NET › Assemblies & NuGet

What is NuGet, and what problem does it solve for .NET developers?

Beginner

Answer

NuGet is .NET's official package manager, providing a standardized way to discover, install, update, and share reusable libraries (packages) across projects, avoiding the need to manually download DLLs and manage their dependencies and versions by hand. Packages are hosted on NuGet.org (public) or private feeds (Azure Artifacts, GitHub Packages, internal servers) for proprietary code.
dotnet add package Newtonsoft.Json
// Downloads the package and its dependencies, adds a PackageReference to the .csproj
Real-world example Instead of manually copying a JSON serialization DLL and its dependency DLLs into a project folder, a developer runs one `dotnet add package` command that handles downloading, dependency resolution, and project file updates automatically.

Common follow-ups: How does NuGet resolve version conflicts between transitive dependencies?;What's the difference between NuGet.org and a private feed?