RaygunCore 2.6.0
dotnet add package RaygunCore --version 2.6.0
NuGet\Install-Package RaygunCore -Version 2.6.0
<PackageReference Include="RaygunCore" Version="2.6.0" />
<PackageVersion Include="RaygunCore" Version="2.6.0" />
<PackageReference Include="RaygunCore" />
paket add RaygunCore --version 2.6.0
#r "nuget: RaygunCore, 2.6.0"
#addin nuget:?package=RaygunCore&version=2.6.0
#tool nuget:?package=RaygunCore&version=2.6.0
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 useRaygunLogger
or intergrate handler into ASP.NET Core pipeline.
Installation via NuGet
Package | Description | NuGet |
---|---|---|
RaygunCore | Raygun client and logger | |
RaygunCore.AspNetCore | Handler for ASP.NET Core request pipeline |
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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Http (>= 9.0.4)
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.4)
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 |