Creating a NuGet package with the NuGet package class library
In this recipe, we will learn how to create a NuGet package with the NuGet package class library.
Getting ready
When we build a .NET project, a DLL file, or an exe file is generated. Every compiled .NET EXE or .NET DLL is a reusable component as well.
A more modern and universal way to create and use reusable components is to create NuGet packages from our code. Thus, we will create these components for personal use in our private organization and share them with the community (thereby making them public) by publishing it in the public NuGet repository.
How to do it...
There's several ways to create a NuGet package.
The old way
- First, we have to download NuGet.exe from the following URL: https://dist.nuget.org/index.html.
- At this page we can choose the latest Windows x86
Commandline.exe
file. - We can also choose the latest VS 2015 VSIX extension for Visual Studio.
- To use
NuGet.exe
to create packages from an assembly, we have to placeNuGet...