Member-only story
.NET Core Worker Service as Windows Service or Linux Daemons

A new type of application template called “Worker Service” was introduced in .NET Core 3 (still in preview as writing this). This is the new way of writing Windows Service or Linux Daemons in .NET Core.
Previously, we can create these services in .NET Core 2.1 using IHostedService
. You can simply create a console app in .NET Core 2.1 and use the TopSelf NuGet package (there are other ways too) to listen for start and stop signals from WindowsService
. You are all done. Then why worker service?
What is Worker Service and When to use it?
The intention of this application type to provide an entry point for long running services in .NET Core. The perfect use case is any long-running background processing to handle the messages from any queues, or if you are wanting to check the health of your apps. A worker service is a straightforward framework for these kinds of use cases. You can deploy it either as a Windows service or as a Linux daemon. Here is the step by step walkthrough to create a simple Worker Service as Windows Service and Linux Daemons.
A Step by Step guide to create Worker Service
Download sample source here
- Install the latest .NET Core 3.0 RC1 SDK…