A few weeks ago I published my first C# NuGet package. The package is a RSS and ATOM FeedReader library that I developed, because existing libraries had issues with encodings, different languages or others. In this blog post, I will quickly describe how to create a NuGet package for a C# library.
The first thing to do is to install nuget.exe. This can be done by downloading the nuget.exe from nuget.org or by using chocolatey. I already blogged about how to use chocolatey (Chocolatey – Package management for Windows) and we will reuse that for the nuget install.
I already blogged about the package management module of the Powershell and how great and awesome it is (Powershell package management – NuGet, Chocolatey and Co). It just can happen, that the installation of some modules from chocolatey do not work as expected. I had this e.g. for Firefox or Chrome. In such cases, it’s better to directly use chocolatey (choco.exe).
Fastest way to install and run it is to open Powershell as administrator and execute the following script:
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
This installs chocolatey and adds it to the path. After that, you should be able to run chocolatey:
choco install firefox -x86
choco install notepadplusplus -x86 # 64 bit version does not have all plugins
There is a new feature available for Powershell since the release of Windows 10. It’s a (open source) package management tool called OneGet. It allows o add different package managers (NuGet, chocolatey, …) and install packages from those sources.
That’s really awesome as we know the useful apt-get or as developers in the Microsoft area – the nice NuGet Package manager. Such package management is now available for Powershell! So let’s have a look on the basic features of it and let’s start with NuGet for Powershell.