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
                    
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="Nedo.AspNet.Exception.AspNetCore" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.Exception.AspNetCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.Exception.AspNetCore" />
                    
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 Nedo.AspNet.Exception.AspNetCore --version 1.0.0
                    
#r "nuget: Nedo.AspNet.Exception.AspNetCore, 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 Nedo.AspNet.Exception.AspNetCore@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=Nedo.AspNet.Exception.AspNetCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.Exception.AspNetCore&version=1.0.0
                    
Install as a Cake Tool

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 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. 
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 99 5/2/2026