NuGet is the official package-manager for .NET. Packages are basically compiled library with some descriptive metadata. NuGet is an essential tool for any modern development platform is a mechanism through which developers can create, share, and consume useful code. Often such code is bundled into “packages” that contain compiled code along with other content needed in the projects that consume these packages. NuGet package contains a single ZIP file with the extension of .nupkg that consists of compiled code (DLLs), and information like the package’s version number.
NuGet itself handles all of the intermediate details, for example if a developer with code who wants to share create a package and publish them on a public or private host. Package consumers then obtain those packages from the suitable hosts, and add them to their projects, and at last call a package functionality in their code. NuGet packages code that is developed by an organization can be used as it supports private hosts along with the public nugget.org host. NuGet packages can also be used in a convenient way to factor your code by using it in your projects. Nuget is considered as a shareable unit of code, but it doesn’t require any specific means of sharing.
- NuGet provides the central nuget.org repository with support for private hosting.
- NuGet provides the tools developers need for creating, publishing, and consuming packages.
- NuGet maintains a reference list of packages used in a project and the ability to restore and update those packages from that list.
- Beyond this, NuGet maintains all the specifications related to how packages are structured such as localization and how they are referenced. Nuget provides numerous APIs for working with all of its services programmatically as well as provides support for developers who publishes Visual Studio extensions.
- NuGet provides a package cache and a global folder for packages to ease the installation along with the reinstallation process. The cache will be useful if there’s a package that already in the local machine.
NuGet helps in the overall dependency graph, this leads to avoiding multiple references to different versions of the same package. Some of the utility packages are employed by many other packages. So you could easily have more references to different versions of the same package. To avoid bringing the different versions of the same package into your project, NuGet sorts out which single version can be used by all the consumers. i.e. it solves dependency problems in one’s own project.