Xavier 1.0.4
dotnet add package Xavier --version 1.0.4
NuGet\Install-Package Xavier -Version 1.0.4
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="Xavier" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xavier" Version="1.0.4" />
<PackageReference Include="Xavier" />
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 Xavier --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xavier, 1.0.4"
#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 Xavier@1.0.4
#: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=Xavier&version=1.0.4
#tool nuget:?package=Xavier&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Xavier
Opinionated but customizable API defaults pack for ASP.NET Core.
Xavier bundles common cross-cutting concerns into a simple, one-liner setup — no boilerplate required.
Install
dotnet add package Xavier
Quick Start
Minimal API
using Xavier.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.AddXavier();
var app = builder.Build();
app.UseXavier();
app.MapXavierInfrastructureEndpoints();
app.MapGet("/", () => "Hello World!");
app.Run();
Controllers
using Xavier.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.AddXavier();
var app = builder.Build();
app.UseXavier();
app.MapControllers();
app.MapXavierInfrastructureEndpoints();
app.Run();
What You Get
| Feature | Description | Default |
|---|---|---|
| ProblemDetails | RFC 7807 error responses with trace/correlation IDs | Enabled |
| Correlation ID | Request tracking with X-Correlation-Id header |
Enabled |
| Health Endpoints | /health (liveness) and /ready (readiness) |
Enabled |
| OpenAPI | Document exposure at /openapi/v1.json (net8+) |
Enabled |
| HTTP Logging | Safe-by-default request/response logging | Disabled |
| Rate Limiting | Global, Per-IP, Per-Client policies (net7+) | Disabled |
| Resilience | HttpClient retry/timeout/circuit-breaker (net8+) | Disabled |
| Observability | OpenTelemetry wiring (no forced exporters) | Disabled |
Framework Support
| Feature | net6.0 | net7.0 | net8.0 | net9.0 | net10.0 |
|---|---|---|---|---|---|
| Error Handling | Yes | Yes | Yes | Yes | Yes |
| Correlation ID | Yes | Yes | Yes | Yes | Yes |
| Health Endpoints | Yes | Yes | Yes | Yes | Yes |
| HTTP Logging | Yes | Yes | Yes | Yes | Yes |
| Rate Limiting | - | Yes | Yes | Yes | Yes |
| OpenAPI | - | - | Yes | Yes | Yes |
| Resilience | - | - | Yes | Yes | Yes |
| Observability | Yes | Yes | Yes | Yes | Yes |
Unsupported features gracefully no-op (warning logged, no crash).
Configuration
All features are configurable via code or appsettings.json:
{
"Xavier": {
"Correlation": {
"Enabled": true,
"HeaderName": "X-Correlation-Id"
},
"ErrorHandling": {
"Enabled": true,
"IncludeExceptionDetails": false
},
"HttpLogging": {
"Enabled": false
},
"RateLimiting": {
"Enabled": false,
"PermitLimit": 100,
"WindowSeconds": 60
},
"OpenApi": {
"Enabled": true,
"DocumentName": "v1"
},
"Health": {
"Enabled": true,
"LivenessPath": "/health",
"ReadinessPath": "/ready"
},
"Observability": {
"Enabled": false
}
}
}
Or via code:
builder.AddXavier(options =>
{
options.RateLimiting.Enabled = true;
options.RateLimiting.PermitLimit = 100;
options.Observability.Enabled = true;
options.Observability.ServiceName = "MyApi";
});
Security Defaults
- Exception details hidden in production
- Sensitive headers (Authorization, Cookie) excluded from HTTP logging
- OpenAPI only exposed in Development environment
- Rate limiting available to prevent abuse
Links
License
MIT - Taiizor
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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.
-
net10.0
- Microsoft.Extensions.Http.Resilience (>= 10.1.0)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
-
net6.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.1)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
-
net7.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.1)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
-
net8.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Http.Resilience (>= 10.1.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.1)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
-
net9.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Http.Resilience (>= 10.1.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.1)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.