worker-services

Featured

Build long-running .NET background services with `BackgroundService`, Generic Host, graceful shutdown, configuration, logging, and deployment patterns suited to workers and daemons. USE FOR: background services; scheduled workers; hosted services; worker extraction; graceful shutdown, health checks, and service hosting review. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

Data & Documents 463 stars 35 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
89
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# .NET Worker Services ## Trigger On - building long-running background services or scheduled workers - adding hosted services to an app or extracting them into a worker process - reviewing graceful shutdown, cancellation, queue processing, or health behavior ## Documentation - [Worker Services in .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) - [Background tasks with hosted services in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-10.0) - [Create Windows Service using BackgroundService](https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service) - [App health checks in .NET](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/diagnostic-health-checks) - [Health checks in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-10.0) ### References - [patterns.md](references/patterns.md) - BackgroundService patterns, graceful shutdown, and health check implementations - [anti-patterns.md](references/anti-patterns.md) - Common worker service mistakes and how to avoid them ## Workflow 1. **Use BackgroundService as your base class:** - Provides standard `StartAsync`/`StopAsync` handling - Focus on implementing `ExecuteAsync` only - Proper cancellation token management built-in 2. **Handle scoped dependencies correctly:** - Create service scopes for scoped services - No scope is created by default in ...

Details

Author
managedcode
Repository
managedcode/dotnet-skills
Created
4 months ago
Last Updated
2 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category