Worker Service Projects
Create a standalone Worker Service, configure DI and logging, and deploy it as a Windows Service or Linux daemon.
What Is a Worker Service?
A Worker Service is a .NET project template for building long-running background applications — no web server, no HTTP endpoints. It's a lightweight host perfect for queue processors, scheduled tasks, and daemon-style services.
Creating a Worker Service
Use the CLI template to scaffold a Worker Service project. It generates a minimal Program.cs and a Worker.cs class that inherits from BackgroundService.
# Create a new Worker Service project
dotnet new worker -n OrderProcessor
# Generated structure:
# OrderProcessor/
# Program.cs — host configuration
# Worker.cs — your BackgroundService subclass
# appsettings.jsonAll lessons in this course
- IHostedService & BackgroundService
- Worker Service Projects
- Periodic Tasks & Timers
- Quartz.NET Scheduled Jobs