Meziantou.AspNetCore.ServiceDefaults
2.0.7
Prefix Reserved
See the version list below for details.
dotnet add package Meziantou.AspNetCore.ServiceDefaults --version 2.0.7
NuGet\Install-Package Meziantou.AspNetCore.ServiceDefaults -Version 2.0.7
<PackageReference Include="Meziantou.AspNetCore.ServiceDefaults" Version="2.0.7" />
<PackageVersion Include="Meziantou.AspNetCore.ServiceDefaults" Version="2.0.7" />
<PackageReference Include="Meziantou.AspNetCore.ServiceDefaults" />
paket add Meziantou.AspNetCore.ServiceDefaults --version 2.0.7
#r "nuget: Meziantou.AspNetCore.ServiceDefaults, 2.0.7"
#:package Meziantou.AspNetCore.ServiceDefaults@2.0.7
#addin nuget:?package=Meziantou.AspNetCore.ServiceDefaults&version=2.0.7
#tool nuget:?package=Meziantou.AspNetCore.ServiceDefaults&version=2.0.7
Meziantou.AspNetCore.ServiceDefaults
A comprehensive ASP.NET Core library that provides opinionated defaults and best practices for building production-ready web applications. This library configures common features like OpenTelemetry, health checks, resilience, service discovery, and security settings with sensible defaults.
Usage
Basic Setup
Add the service defaults to your ASP.NET Core application:
using Meziantou.AspNetCore.ServiceDefaults;
var builder = WebApplication.CreateBuilder(args);
// Add Meziantou service defaults
builder.UseMeziantouConventions();
var app = builder.Build();
// Map default endpoints (health checks, OpenAPI, etc.)
app.MapMeziantouDefaultEndpoints();
app.MapGet("/", () => "Hello World!");
app.Run();
Try Pattern
Use TryUseMeziantouConventions to avoid registering the service defaults multiple times:
builder.UseMeziantouConventions();
builder.TryUseMeziantouConventions(); // Will not register again
Validation
The library validates that MapMeziantouDefaultEndpoints() is called. If you forget to call it, an InvalidOperationException will be thrown at startup.
| 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. net11.0 is compatible. |
-
net10.0
- Meziantou.AspNetCore (>= 2.0.1)
- Microsoft.AspNetCore.OpenApi (>= 10.0.11)
- Microsoft.Extensions.Http.Resilience (>= 10.9.0)
- Microsoft.Extensions.ServiceDiscovery (>= 10.9.0)
- Microsoft.OpenApi (>= 2.12.2)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.18.0)
- OpenTelemetry.Instrumentation.Http (>= 1.18.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.18.0)
-
net11.0
- Meziantou.AspNetCore (>= 2.0.1)
- Microsoft.AspNetCore.OpenApi (>= 11.0.0-preview.7.26381.103)
- Microsoft.Extensions.Http.Resilience (>= 10.9.0)
- Microsoft.Extensions.ServiceDiscovery (>= 10.9.0)
- Microsoft.OpenApi (>= 3.10.2)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.18.0)
- OpenTelemetry.Instrumentation.Http (>= 1.18.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.18.0)
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 |
|---|---|---|
| 2.0.10 | 83 | 10/5/2026 |
| 2.0.9 | 149 | 9/27/2026 |
| 2.0.8 | 1,082 | 9/11/2026 |
| 2.0.7 | 354 | 9/6/2026 |
| 2.0.6 | 1,437 | 8/29/2026 |
| 2.0.5 | 1,454 | 8/16/2026 |
| 2.0.4 | 1,127 | 8/9/2026 |
| 2.0.3 | 886 | 7/17/2026 |
| 2.0.2 | 118 | 7/12/2026 |
| 2.0.1 | 1,126 | 7/8/2026 |
| 2.0.0 | 371 | 7/5/2026 |
| 1.0.43 | 679 | 7/1/2026 |
| 1.0.42 | 96 | 6/28/2026 |
| 1.0.41 | 870 | 6/13/2026 |
| 1.0.40 | 72 | 6/13/2026 |
| 1.0.39 | 255 | 5/31/2026 |
| 1.0.38 | 692 | 5/23/2026 |
| 1.0.37 | 644 | 5/14/2026 |
| 1.0.36 | 256 | 5/11/2026 |
| 1.0.35 | 612 | 5/3/2026 |