Nedo.AspNet.Exception.AspNetCore
1.0.0
dotnet add package Nedo.AspNet.Exception.AspNetCore --version 1.0.0
NuGet\Install-Package Nedo.AspNet.Exception.AspNetCore -Version 1.0.0
<PackageReference Include="Nedo.AspNet.Exception.AspNetCore" Version="1.0.0" />
<PackageVersion Include="Nedo.AspNet.Exception.AspNetCore" Version="1.0.0" />
<PackageReference Include="Nedo.AspNet.Exception.AspNetCore" />
paket add Nedo.AspNet.Exception.AspNetCore --version 1.0.0
#r "nuget: Nedo.AspNet.Exception.AspNetCore, 1.0.0"
#:package Nedo.AspNet.Exception.AspNetCore@1.0.0
#addin nuget:?package=Nedo.AspNet.Exception.AspNetCore&version=1.0.0
#tool nuget:?package=Nedo.AspNet.Exception.AspNetCore&version=1.0.0
Nedo.AspNet.Exception.AspNetCore
ASP.NET Core integration: IExceptionHandler that emits the platform-standard Nedo.AspNet.ApiContracts.Responses.BaseResponse<T> envelope (RFC 9457 problem+json) for any thrown Nedo or stock .NET exception, plus DI extensions and optional middleware fallback.
dotnet add package Nedo.AspNet.Exception.AspNetCore
Relationship to Nedo.AspNet.ApiContracts
This package depends on Nedo.AspNet.ApiContracts (≥ 2.0.0) and emits the same envelope as every other endpoint on the platform. It subsumes AddGlobalExceptionHandler() — do NOT call both.
- builder.Services.AddGlobalExceptionHandler();
+ builder.Services.AddNedoExceptions();
Same wire shape; the 11-prefix ErrorCodes taxonomy replaces the small ad-hoc set (ERR-NF-001, ERR-AUTH-001, …).
Quickstart
using Nedo.AspNet.Exception.AspNetCore;
builder.Services.AddNedoExceptions(opts =>
{
opts.IncludeExceptionDetails = builder.Environment.IsDevelopment();
// Format defaults to ResponseFormat.ApiContracts; switch to NedoLegacyEnvelope for brownfield frontends.
// MaskServerErrors defaults to true (5xx leak suppression); MapStockExceptions defaults to true.
});
// Customize the RFC 9457 `type` URI base globally (Nedo.AspNet.ApiContracts setting):
Nedo.AspNet.ApiContracts.Responses.ProblemTypes.BaseUri = "https://errors.example.com/";
var app = builder.Build();
app.UseNedoExceptions();
Response shape
A thrown NotFoundException("User 42 not found") becomes:
{
"success": false,
"type": "urn:nedo:problems:ERR-RES-NF",
"title": "Not Found",
"status": 404,
"detail": "User 42 not found",
"instance": "/users/42",
"code": "ERR-RES-NF",
"info": {
"transaction_id": "00-…",
"timestamp": "2026-05-02 12:34:56 UTC",
"operation_type": "Exception",
"trace_id": "…",
"span_id": "…"
}
}
The exception's Metadata dictionary surfaces in errors[0].data (4xx only). IValidationException failures populate errors[0].error_details.form_errors / field_errors. ServiceUnavailableException carries retry_after_seconds / estimated_end_at in errors[0].data plus the Retry-After HTTP header.
5xx responses are masked by default — real code, detail, metadata, and custom IResponseInfoContributor output are stripped from the wire and replaced with ERR-SRV + a generic message; full detail goes to the server log keyed by transaction_id. See docs/06-aspnetcore-integration.md for the full security model.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.0
- Nedo.AspNet.ApiContracts (>= 2.0.0)
- Nedo.AspNet.Exception (>= 1.0.0)
- Nedo.AspNet.Exception.Abstractions (>= 1.0.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 |
|---|---|---|
| 1.0.0 | 99 | 5/2/2026 |