RaygunCore 2.6.0

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

Raygun provider for .NET

Standart Raygun4Net library does not work well with .NET. So I've created library for new architecture:

  • Built with interfaces and works via default dependency injection;
  • As result, services can be easily extended or replaced;
  • You can work via IRaygunClient directly or use RaygunLogger or intergrate handler into ASP.NET Core pipeline.

Installation via NuGet

Package Description NuGet
RaygunCore Raygun client and logger NuGet
RaygunCore.AspNetCore Handler for ASP.NET Core request pipeline NuGet

How to use with ASP.NET Core

Register services in Startup class:

public void ConfigureServices(IServiceCollection services)
{
    // configure with API KEY
    services.AddRaygun("_API_KEY_")
        .WithHttp();

    // or with options
    services.AddRaygun(opt => opt.ApiKey = "_API_KEY_")
        .WithHttp();

    // or with configuration section
    services.AddRaygun(configuration)
        .WithHttp();
}

Method AddRaygun() registers only minimal required services. So then you can request IRaygunClient service and send errors:

public async Task<string> ActionInController([FromServices]IRaygunClient raygun)
{
    try
    {
        // some code
    }
    catch (Exception ex)
    {
        await raygun.SendAsync(ex);
    }
    return "OK";
}

Method WithHttp() in application services registration adds pipeline handler so any exception in request is automatically sent to Raygun.

How to use with logging

You can register Raygun logger provider:

WebHost.CreateDefaultBuilder(args)
    .UseStartup<Startup>()
    .ConfigureLogging((context, logging) => logging
        .AddRaygun(r => r
            .Configure(opt => opt.ApiKey = "_API_KEY_")
            .WithHttp()
        )
    );

Then just use logger:

public async Task<string> ActionInController([FromServices]ILogger<MyController> logger)
{
    logger.LogError(0, "My error message");
}

License

This package has MIT license. Refer to the LICENSE for detailed information.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RaygunCore:

Package Downloads
RaygunCore.AspNetCore

Raygun provider for ASP.NET Core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.6.0 130 5/6/2025
2.5.0 474 11/13/2024
2.4.0 287 6/24/2024
2.3.0 932 3/20/2023
2.2.0 274 3/15/2023
2.1.0 471 12/22/2022
2.0.0 2,105 3/29/2022
1.6.0 3,048 1/11/2020
1.5.0 901 11/18/2019
1.4.0 2,535 12/5/2018
1.3.1 934 12/3/2018
1.3.0 1,212 11/7/2018
1.2.0 966 10/24/2018
1.1.0 2,634 6/27/2018
1.0.2 4,286 2/13/2018
1.0.1 1,225 2/12/2018