![]() |
VOOZH | about |
dotnet add package Mindscape.Raygun4Net.NetCore --version 11.2.5
NuGet\Install-Package Mindscape.Raygun4Net.NetCore -Version 11.2.5
<PackageReference Include="Mindscape.Raygun4Net.NetCore" Version="11.2.5" />
<PackageVersion Include="Mindscape.Raygun4Net.NetCore" Version="11.2.5" />Directory.Packages.props
<PackageReference Include="Mindscape.Raygun4Net.NetCore" />Project file
paket add Mindscape.Raygun4Net.NetCore --version 11.2.5
#r "nuget: Mindscape.Raygun4Net.NetCore, 11.2.5"
#:package Mindscape.Raygun4Net.NetCore@11.2.5
#addin nuget:?package=Mindscape.Raygun4Net.NetCore&version=11.2.5Install as a Cake Addin
#tool nuget:?package=Mindscape.Raygun4Net.NetCore&version=11.2.5Install as a Cake Tool
When you create a new application on your Raygun dashboard, your app API key is displayed within the instructions page. You can also find the API key by clicking the "Application Settings" button in the side bar of the Raygun dashboard.
The main classes can be found in the Mindscape.Raygun4Net namespace.
Install the Mindscape.Raygun4Net.NetCore NuGet package into your project. You can either use the below dotnet CLI command, or the NuGet management GUI in the IDE you use.
dotnet add package Mindscape.Raygun4Net.NetCore
Create an instance of RaygunClient by passing your app API key to the constructor, and hook it up to the unhandled exception delegate. This is typically done in Program.cs or the main method.
using Mindscape.Raygun4Net;
private static RaygunClient _raygunClient = new RaygunClient("paste_your_api_key_here");
AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
_raygunClient.Send(e.ExceptionObject as Exception);
Alternatively you can configure RaygunClient to automatically report any Unhandled Exceptions directly to Raygun
using Mindscape.Raygun4Net;
private static RaygunSettings _raygunSettings = new RaygunSettings
{
ApiKey = "paste_your_api_key_here",
CatchUnhandledExceptions = true // automatically reports any unhandled exceptions to Raygun
};
private static RaygunClient _raygunClient = new RaygunClient(_raygunSettings);
Add some temporary code to throw an exception and manually send it to Raygun.
try
{
...
}
catch (Exception e)
{
_raygunClient.SendInBackground(e);
}
The above instructions will setup Raygun4Net to automatically detect and send all unhandled exceptions. Sometimes you may want to send exceptions manually, such as handled exceptions from within a try/catch block.
RaygunClient provides Send and SendInBackground methods for manually sending to Raygun. It's important to note that SendInBackground should only be used for handled exceptions, rather than exceptions that will cause the application to crash - otherwise the application will most likely shutdown all threads before Raygun is able to finish sending.
On a RaygunClient instance, attach an event handler to the SendingMessage event. This event handler will be called just before the RaygunClient sends an exception - either automatically or manually. The event arguments provide the RaygunMessage object that is about to be sent. One use for this event handler is to add or modify any information on the RaygunMessage. Another use for this method is to identify exceptions that you never want to send to raygun, and if so, set e.Cancel = true to cancel the send.
If you have common outer exceptions that wrap a valuable inner exception which you'd prefer to group by, you can specify these by using the multi-parameter method:
RaygunClient.AddWrapperExceptions(typeof(TargetInvocationException));
In this case, if a TargetInvocationException occurs, it will be removed and replaced with the actual InnerException that was the cause. Note that TargetInvocationException is already added to the wrapper exception list; you do not have to add this manually. This method is useful if you have your own custom wrapper exceptions, or a framework is throwing exceptions using its own wrapper.
There are properties named User and UserInfo on RaygunClient which you can set to provide user info such as ID and email address This allows you to see the count of affected users for each error in the Raygun dashboard. If you provide an email address, and the user has an associated Gravatar, you will see their avatar in the error instance page.
Make sure to abide by any privacy policies that your company follows when using this feature.
You can provide an application version value by setting the ApplicationVersion property of the RaygunClient (in the format x.x.x.x where x is a positive integer).
You can optionally specify an Offline Store for crash reports when creating your RaygunClient.
When an offline store is specified, if there are any issues sending an exception to the Raygun API, a copy of the exception may be stored locally to be retried at a later date.
An exception is stored offline when one of the following conditions are met:
// Attempt to send any offline crash reports every 30 seconds
var sendStrategy = new TimerBasedSendStrategy(TimeSpan.FromSeconds(30));
// Store crash reports in Local AppData
var offlineStore = new LocalApplicationDataCrashReportStore(sendStrategy);
var raygunClient = new RaygunClient(new RaygunSettings()
{
ApiKey = "paste_your_api_key_here",
// Optionally store
OfflineStore = offlineStore
});
You may extend and create your own custom implementations of OfflineStoreBase and IBackgroundSendStrategy to further customize where errors are stored, and when they are sent.
When sending exceptions manually, you can also send an arbitrary list of tags (an array of strings), and a collection of custom data (a dictionary of any objects). This can be done using the various Send and SendInBackground method overloads.
See the Raygun docs for more detailed instructions on how to use this provider.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Mindscape.Raygun4Net.NetCore:
| Package | Downloads |
|---|---|
|
Serilog.Sinks.Raygun
Serilog event sink that writes to the Raygun service. |
|
|
Raygun4Maui
Raygun's Crash Reporting and Real User Monitoring Provider for MAUI .NET |
|
|
Mindscape.Raygun4Net.NetCore.Signed
Package is deprecated, please use `Mindscape.Raygun4Net.NetCore` which is signed. |
|
|
Splat.Raygun
A library to make things cross-platform that should be. |
|
|
AspNetCore.AutoHealthCheck.Raygun
Auto Health Check integration for Raygun. |
Showing the top 1 popular GitHub repositories that depend on Mindscape.Raygun4Net.NetCore:
| Repository | Stars |
|---|---|
|
reactiveui/splat
Makes things cross-platform
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.2.6-pre-3 | 134 | 3/10/2026 |
| 11.2.6-pre-2 | 156 | 3/8/2026 |
| 11.2.6-pre-1 | 119 | 3/5/2026 |
| 11.2.5 | 113,410 | 12/29/2025 |
| 11.2.5-pre-2 | 504 | 12/18/2025 |
| 11.2.5-pre-1 | 313 | 11/11/2025 |
| 11.2.4 | 107,690 | 6/17/2025 |
| 11.2.4-pre-3 | 268 | 6/5/2025 |
| 11.2.4-pre-2 | 263 | 5/28/2025 |
| 11.2.4-pre-1 | 250 | 5/22/2025 |
| 11.2.3 | 39,999 | 4/29/2025 |
| 11.2.2 | 54,400 | 2/20/2025 |
| 11.2.1 | 211,888 | 12/11/2024 |
| 11.2.0 | 3,697 | 12/10/2024 |
| 11.2.0-pre-1 | 262 | 12/8/2024 |
| 11.1.2 | 189,767 | 11/12/2024 |
| 11.1.2-pre-2 | 230 | 11/12/2024 |
| 11.1.2-pre-1 | 520 | 9/17/2024 |
| 11.1.1 | 74,446 | 9/12/2024 |
| 11.1.0 | 205,969 | 8/25/2024 |