Dloizides.ServiceDefaults 1.0.0

dotnet add package Dloizides.ServiceDefaults --version 1.0.0
                    
NuGet\Install-Package Dloizides.ServiceDefaults -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dloizides.ServiceDefaults" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dloizides.ServiceDefaults" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Dloizides.ServiceDefaults" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dloizides.ServiceDefaults --version 1.0.0
                    
#r "nuget: Dloizides.ServiceDefaults, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dloizides.ServiceDefaults@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dloizides.ServiceDefaults&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Dloizides.ServiceDefaults&version=1.0.0
                    
Install as a Cake Tool

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 when OTEL_EXPORTER_OTLP_ENDPOINT is 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/ready plus an ACME HTTP-01 (/.well-known/acme-challenge/*) no-op that answers 404 so external probes on the public host don't trip the auth fallback.
  • Postgres connection-string typo normalization: AddServiceDefaults resolves both the correct PostgresConnection key and the historical PostgressConnection typo (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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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