
Aspire Service Defaults
Sets up a shared ServiceDefaults project for .NET Aspire apps, which is the standard pattern for centralizing cross-cutting concerns. You get OpenTelemetry (logging, tracing, metrics), health checks with separate readiness and liveness endpoints, service discovery, and HTTP resilience policies all wired up in one AddServiceDefaults() call. Every service in your Aspire app references this project instead of duplicating the same observability boilerplate. The implementation is straightforward: excludes health check endpoints from traces, configures OTLP export when available, and adds standard resilience handlers to all HttpClients. Health endpoints only expose in development by default, which is sensible. If you're building anything beyond a single-service Aspire app, you want this.
- skills.sh installs
- 497
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aaronontheweb/dotnet-skills --skill aspire-service-defaults --agent claude-codeInstalls into .claude/skills of the current project.
Files
Aspire Service Defaults
When to Use This Skill
Use this skill when:
- Building Aspire-based distributed applications
- Need consistent observability (logging, tracing, metrics) across services
- Want shared health check configuration
- Configuring HttpClient resilience and service discovery
What is ServiceDefaults?
ServiceDefaults is a shared project that provides common configuration for all services in an Aspire application:
- OpenTelemetry - Logging, tracing, and metrics
- Health Checks - Readiness and liveness endpoints
- Service Discovery - Automatic service resolution
- HTTP Resilience - Retry and circuit breaker policies
Every service references this project and calls AddServiceDefaults().
Project Structure
src/
MyApp.ServiceDefaults/
Extensions.cs
MyApp.ServiceDefaults.csproj
MyApp.Api/
Program.cs # Calls AddServiceDefaults()
MyApp.Worker/
Program.cs # Calls AddServiceDefaults()
MyApp.AppHost/
Program.cs
ServiceDefaults Project
Project File
Sponsors
Details
- Repository
- github.com/aaronontheweb/dotnet-skills
- Categories
- Sales & Marketing, .NET & C#
- First seen
- Jun 3, 2026
More from aaronontheweb/dotnet-skills
All 34- Aspire Configuration487
- Snapshot Testing484
- Dotnet Devcert Trust457
- Skills Index Snippets456
- Playwright Ci Caching455
- Akka Net Best Practices451
- Mailpit Integration443
- Verify Email Snapshots436
- Akka Hosting Actor Patterns434
- Akka Net Testing Patterns431
- OpenTelemetry NET Instrumentation431
- Akka Net Management430
- Akka Net Aspire Configuration415
- Marketplace Publishing408
- Modern Csharp Coding Standards2.3K
- Csharp Concurrency Patterns1.6K
- Efcore Patterns1.6K
- Dependency Injection Patterns703
- Database Performance700
- Dotnet Project Structure692
- Api Design690
- Type Design Performance684
- Ilspy Decompile640
- Package Management613