ChokusAlert 1.0.2

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

🚨 Chokus Alert

Chokus Alert is a high-performance, production-ready middleware for ASP.NET Core that automatically captures unhandled exceptions and sends detailed, beautifully formatted HTML email reports to your development team.

Designed for modern, scalable applications, it operates entirely in the background—ensuring zero impact on request performance while keeping your team instantly informed.


✨ Features

⚡ Zero Performance Impact

Captures request and exception data synchronously, then dispatches email notifications on a background thread. Your users never experience delays—even during failures.

🛡️ Intelligent Anti-Spam Protection

Prevents alert flooding using in-memory hashing and caching. Identical errors within a defined time window trigger only one email, no matter how many times they occur.

👔 Professional HTML Reports

Receive structured, easy-to-read email reports including:

  • Exception type and message
  • Request path and HTTP method
  • User-Agent details
  • Source code location (file & line number)
  • Full formatted stack trace

🔒 Secure & Fail-Safe

  • Enforces SSL for SMTP communication
  • Fails silently if the mail server is unavailable
  • Guarantees your main application will never crash due to alerting

🪶 Lightweight & Native

Built exclusively with .NET 9 using native Microsoft libraries. No third-party dependencies. No unnecessary overhead.


📦 Installation

Using NuGet Package Manager

Install-Package ChokusAlert

Using .NET CLI

dotnet add package ChokusAlert

⚙️ Configuration

Add the following section to your appsettings.json:

{
  "ChokusAlert": {
    "Host": "smtp.yourprovider.com",
    "Port": 587,
    "User": "alerts@yourdomain.com",
    "FromEmail": "alerts@yourdomain.com",
    "MuteDuplicateErrorsMinutes": 5,
    "AlertRecipients": [
      "lead.dev@yourdomain.com",
      "backend.team@yourdomain.com"
    ]
  }
}

🔐 Security Best Practice

Never store your SMTP password in source control.

Use secure storage:

Development (User Secrets)
dotnet user-secrets set "ChokusAlert:Pass" "YourSecureAppPassword123!"
Production

Use environment variables or a secure secret manager.


🚀 Usage

Register the service and middleware in Program.cs:

using ChokusAlert;

var builder = WebApplication.CreateBuilder(args);

// Register services (includes memory cache)
builder.Services.AddChokusAlert(builder.Configuration);

builder.Services.AddControllers();

var app = builder.Build();

// Add middleware early in the pipeline
app.UseChokusAlert();

app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

app.Run();

📧 Email Preview

When an unhandled exception occurs, your team receives a structured HTML email like:

Subject:

🚨 [Chokus] NullReferenceException: Object reference not set to an instance...

Details:

Field Value
Type NullReferenceException
Message Object reference not set to an instance of an object
Location UserController.cs: line 42
Request GET /api/users/99
Time 2026-04-29 14:31:00 UTC
Client Mozilla/5.0 ...

Followed by a full, formatted stack trace for deep debugging.


🧠 How It Works

  1. Middleware intercepts unhandled exceptions
  2. Extracts request + environment details instantly
  3. Generates a unique hash for deduplication
  4. Checks cache to prevent duplicate alerts
  5. Sends a formatted email asynchronously

🤝 Contributing

Contributions, issues, and feature requests are welcome.

If you'd like to improve Chokus Alert:

  • Fork the repository
  • Create a feature branch
  • Submit a pull request

📝 License

This project is licensed under the MIT License.

Free for:

  • Commercial use
  • Personal projects
  • Open-source applications

💡 Why Chokus Alert?

Because production errors shouldn't go unnoticed—and they definitely shouldn't slow down your app.

Fast. Silent. Reliable.

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.
  • net9.0

    • No dependencies.

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.2 118 4/29/2026