Lyo.Diagnostic.AspNetCore 1.0.1

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

Lyo.Diagnostic.AspNetCore

ASP.NET Core integration for Lyo.Diagnostic: scoped breadcrumb trails per request and exception recording to the in-memory error inbox plus structured logging, without replacing your existing problem-details middleware.

Examples

Installation

using Lyo.Diagnostic.AspNetCore;

builder.Services.AddLyoDiagnosticsWeb(o =>
{
    o.MinimumSeverity = Lyo.Diagnostic.Classification.ExceptionSeverity.Low;
    o.BreadcrumbCapacity = 100;
    o.InMemoryInboxMaxOccurrences = 5_000;
    o.CorrelationIdHeaders = ["X-Correlation-Id", "X-Request-Id"];
});

// After outer middleware that catches and formats errors (e.g. LoggingMiddleware):
app.UseDiagnosticExceptionRecording();
public sealed class OrdersController(IBreadcrumbTrail breadcrumbs)
{
    public async Task<IActionResult> Get(string id)
    {
        breadcrumbs.Add("orders", "Loading order", new Dictionary<string, string> { ["id"] = id });
        // ...
    }
}

Pipeline ordering

  • This middleware sits closer to route handlers and runs first when an exception unwinds.
  • It records the failure and calls IStructuredLogEnricher, then rethrows.
  • Outer middleware can still build Problem Details / HTTP error bodies.

Options (DiagnosticWebOptions)

Property Purpose
MinimumSeverity Only occurrences at or above this severity are written to the inbox.
RecordExpectedControlFlow When false, expected control-flow classifications are skipped.
BreadcrumbCapacity Max breadcrumbs per request (IBreadcrumbTrail).
InMemoryInboxMaxOccurrences Cap for the singleton InMemoryErrorInbox.
CorrelationIdHeaders Headers tried in order for RequestMetadata.CorrelationId; falls back to TraceIdentifier.

Inject IBreadcrumbTrail (scoped) and add entries before risky work:

Do not put secrets or PII in breadcrumb data. See the Lyo.Diagnostic README.

Lyo.Api

Lyo.Api exposes AddLyoApiDiagnosticRecording as a convenience wrapper around AddLyoDiagnosticsWeb.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Diagnostic — (direct, lyo)
  • Lyo.Common — (transitive, lyo)
  • Lyo.Exceptions — (transitive, lyo)
  • Lyo.Hashing — (transitive, lyo)
  • Lyo.PackageMetadata — (transitive, lyo)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 — (transitive, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 — (transitive, microsoft)
  • System.IO.Hashing 10.0.5 — (transitive, microsoft, net10.0)
  • System.Memory 4.6.3 — (transitive, microsoft, netstandard2.0)
  • System.Text.Json 10.0.5 — (transitive, microsoft, netstandard2.0)
  • System.Threading.Tasks.Extensions 4.6.3 — (transitive, microsoft)
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 (2)

Showing the top 2 NuGet packages that depend on Lyo.Diagnostic.AspNetCore:

Package Downloads
Lyo.Api

Core API library for building RESTful APIs with Entity Framework Core, caching, and mapping support.

Lyo.Authentication.Client

Consumer-side runtime for Lyo.Authentication. Used by Gateway / web hosts that need to redeem a Lyo handoff code, maintain a server-side session keyed by an HttpOnly cookie, project the signed-in Lyo user into Blazor's AuthenticationStateProvider, and inject a Bearer header on outbound API calls (with automatic refresh on 401). Pairs with the Lyo.Authentication.OpenIdConnect endpoints on the API side.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 0 8/18/2026
1.0.0 121 8/16/2026