Dloizides.ServiceDefaults
1.0.0
dotnet add package Dloizides.ServiceDefaults --version 1.0.0
NuGet\Install-Package Dloizides.ServiceDefaults -Version 1.0.0
<PackageReference Include="Dloizides.ServiceDefaults" Version="1.0.0" />
<PackageVersion Include="Dloizides.ServiceDefaults" Version="1.0.0" />
<PackageReference Include="Dloizides.ServiceDefaults" />
paket add Dloizides.ServiceDefaults --version 1.0.0
#r "nuget: Dloizides.ServiceDefaults, 1.0.0"
#:package Dloizides.ServiceDefaults@1.0.0
#addin nuget:?package=Dloizides.ServiceDefaults&version=1.0.0
#tool nuget:?package=Dloizides.ServiceDefaults&version=1.0.0
Dloizides.ServiceDefaults
Aspire-style service defaults for the platform's ASP.NET Core services, extracted from the
per-service ServiceDefaults/Extensions.cs files that had each been hand-copied (and had drifted).
One implementation, shared by the fleet:
- OpenTelemetry logging + metrics + tracing wiring (
ConfigureOpenTelemetry), with the OTLP exporter enabled whenOTEL_EXPORTER_OTLP_ENDPOINTis set. - HTTP resilience + service discovery defaults for
HttpClient. - Health checks via
ServiceDefaults.HealthChecks(liveness/startup registration + a Postgres readiness check). - Platform endpoint map (
MapPlatformHealthChecks): the anonymous Kubernetes probes/health/live,/health/start,/health/readyplus an ACME HTTP-01 (/.well-known/acme-challenge/*) no-op that answers404so external probes on the public host don't trip the auth fallback. - Postgres connection-string typo normalization:
AddServiceDefaultsresolves both the correctPostgresConnectionkey and the historicalPostgressConnectiontypo (correct wins), so services can canonicalize the spelling without a config flag day.
Usage
// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults(); // OTel + health checks + service discovery + resilient HttpClient
var app = builder.Build();
// ... auth / middleware ...
app.MarkAsReady(); // from ServiceDefaults.HealthChecks, after migrations/seeding
app.MapPlatformHealthChecks(); // anonymous /health/live|start|ready + ACME no-op
app.MapDefaultEndpoints(); // dev-only /health + /alive
app.Run();
The builder extensions live in the Microsoft.Extensions.Hosting namespace, so existing call
sites resolve them through implicit usings with no using change.
Target framework
net10.0 — matches every consuming service and the ServiceDefaults.HealthChecks dependency.
MIT licensed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Http.Resilience (>= 9.7.0)
- Microsoft.Extensions.ServiceDiscovery (>= 9.3.1)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.12.0)
- OpenTelemetry.Instrumentation.Http (>= 1.12.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.12.0)
- ServiceDefaults.HealthChecks (>= 1.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 185 | 7/17/2026 |