Home > Software design >  Does a package (nuget package) contain assemblies or libraries?
Does a package (nuget package) contain assemblies or libraries?

Time:09-28

I came across two different sources that stated two diferrent things about what a package contains.

Nuget 101 states:

A package contains a complied library with descriptive meta data.

While What is Nuget states:

Package developers who require APIs outside of .NET Standard, on the other hand, create separate assemblies for the different target frameworks they want to support and include all of those assemblies in the same package (which is called "multi-targeting").

So does a package contain an assembly(ies) or a library(ies)? Which is it?

CodePudding user response:

According to Microsofts documentation an Assembly is the fundament to provide a library. You could say a library is a collection of classes and functions to provide functionality and the assembly is the technical plattform to transport this library and make it available to use it in your projects (e.g. a dynamic link library (dll)). A library can be splitted into multiple assemblies.

In terms of NuGet the difference is not significant. NuGet wraps the assemblies into a NuGet package so that the deployment works automatically using the package manager of nuget.

I hope I could clarify it a bit with that answer.

  • Related