EasyException.AspNetCore 0.1.0

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

EasyException (WIP)

EasyException is a set of NuGet packages that capture unhandled exceptions in ASP.NET Core and analyze the exception asynchronously with a local LLM (Ollama).

Design goals:

  • Do not block the request while the LLM runs (analysis happens in a background queue).
  • Keep the original exception; analysis is attached via Exception.Data["EasyException.Analysis"] when possible.

Packages (in this repo)

  • EasyException.Core: core types (ExceptionReport, breadcrumbs, analyzer contracts)
  • EasyException.Analyzers.Ollama: IExceptionAnalyzer implementation for Ollama
  • EasyException.AspNetCore: middleware + DI + background analysis queue

ASP.NET Core usage

1) Register services

using EasyException.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEasyException(
    configure: options =>
    {
        options.BreadcrumbCapacity = 200;
        options.MaxQueueSize = 256;
        options.AnalysisTimeout = TimeSpan.FromSeconds(10);
    },
    configureOllama: ollama =>
    {
        ollama.BaseUrl = new Uri("http://localhost:11434/");
        ollama.Model = "llama3.2";
        ollama.Timeout = TimeSpan.FromSeconds(10);
    });

var app = builder.Build();

2) Add middleware

app.UseEasyException();

When an unhandled exception happens, the middleware will enqueue it for analysis and attach:

  • Exception.Data["EasyException.Id"]
  • Exception.Data["EasyException.Fingerprint"]
  • Exception.Data["EasyException.AnalysisStatus"] (queued/completed/failed)
  • Exception.Data["EasyException.Analysis"] (human-readable analysis, when completed)

Sample WebAPI (for testing)

This repo includes a runnable WebAPI sample:

  • samples/EasyException.SampleWebApi

Run it:

dotnet run --project .\samples\EasyException.SampleWebApi\EasyException.SampleWebApi.csproj --urls http://localhost:5055

Trigger an exception:

Invoke-RestMethod http://localhost:5055/boom -Method Get -SkipHttpErrorCheck

You should see EasyException analysis completed... in the server logs.

Setting up Ollama locally (Windows)

Install

Option A (Winget):

winget install Ollama.Ollama

Option B: download from https://ollama.com/download

Start Ollama

Ollama typically runs a local server on http://localhost:11434/.

If it’s not already running, start it:

ollama serve

Pull a model

ollama pull llama3.2

(You can use any Ollama model name you have installed.)

Quick health check

Invoke-RestMethod http://localhost:11434/api/tags

If that returns JSON, the server is up.

Notes / caveats

  • Breadcrumbs are what make “steps before the exception” possible. Without them, an LLM can only infer from stack traces/logs and may be wrong.
  • This project is intentionally minimal; add redaction, throttling/deduping, and storage if you plan to ship it broadly.
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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
0.1.0 123 3/12/2026