Kresis.ErrorTracker.AspNetCore 0.1.1

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

Kresis Error Tracker - C# SDK

C# SDK for reporting errors to Kresis Error Tracker. Two packages available:

Package Description
Kresis.ErrorTracker Core SDK for any .NET application
Kresis.ErrorTracker.AspNetCore ASP.NET Core middleware integration

Installation

dotnet add package Kresis.ErrorTracker

# For ASP.NET Core apps:
dotnet add package Kresis.ErrorTracker.AspNetCore

Quick Start

Console / Worker / Generic .NET

using Kresis.ErrorTracker;

KresisErrorTracker.Init(new ErrorTrackerOptions
{
    Dsn = "your-project-dsn",
    Endpoint = "https://errors.kresis.ai",
    Environment = "production",
    Release = "1.0.0"
});

// Errors are captured automatically via AppDomain.UnhandledException
// and TaskScheduler.UnobservedTaskException.

// Manual capture:
try
{
    // ...
}
catch (Exception ex)
{
    KresisErrorTracker.CaptureException(ex);
}

// Capture a message:
KresisErrorTracker.CaptureMessage("Something noteworthy happened");

ASP.NET Core

// Program.cs
builder.Services.AddKresisErrorTracker(options =>
{
    options.Dsn = builder.Configuration["ErrorTracker:Dsn"]!;
    options.Endpoint = builder.Configuration["ErrorTracker:Endpoint"]!;
    options.Environment = builder.Environment.EnvironmentName;
});

app.UseKresisErrorTracker(); // Add early in the pipeline

The middleware automatically captures unhandled exceptions with request context (URL, method, headers) and user identity from HttpContext.User.

Features

User Context

KresisErrorTracker.SetUser(new UserContext
{
    Id = "user-123",
    Email = "alice@example.com",
    Username = "alice"
});

Tags and Extra Data

KresisErrorTracker.CaptureException(ex, new CaptureContext
{
    Tags = new Dictionary<string, string>
    {
        ["component"] = "payment",
        ["region"] = "eu-west-1"
    },
    Extra = new Dictionary<string, object>
    {
        ["orderId"] = orderId,
        ["retryCount"] = 3
    }
});

BeforeSend Hook

Filter or modify events before they are sent:

KresisErrorTracker.Init(new ErrorTrackerOptions
{
    Dsn = "your-dsn",
    Endpoint = "https://errors.kresis.ai",
    BeforeSend = payload =>
    {
        // Drop events from health checks
        if (payload.Url?.Contains("/health") == true)
            return null;

        return payload;
    }
});

Configuration

Option Type Default Description
Dsn string required Project DSN from Kresis
Endpoint string required Error tracker API URL
Environment string? null e.g. "production", "staging"
Release string? null App version or git SHA
ServerName string? Machine name Server/host identifier
AutoCapture bool true Hook global unhandled exceptions
BeforeSend Func<ErrorPayload, ErrorPayload?>? null Modify or drop events

License

MIT

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

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.1 241 2/5/2026
0.1.0 129 2/5/2026