In my previous article, we discussed Web API self-hosting using a console application. This time, we will use a Windows Service to do the self-hosting of the Web API. So let’s start by creating a new Windows Service project type. We call it WindowsService_HostAPI.
In order to perform the self-hosting of the Web API, we need to add references to the self-hosting libraries. For this, we use the Nuget Package Manager and install the references.