Sentry 0.0.1-preview4

Prefix Reserved
This is a prerelease version of Sentry.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Sentry --version 0.0.1-preview4
                    
NuGet\Install-Package Sentry -Version 0.0.1-preview4
                    
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="Sentry" Version="0.0.1-preview4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sentry" Version="0.0.1-preview4" />
                    
Directory.Packages.props
<PackageReference Include="Sentry" />
                    
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 Sentry --version 0.0.1-preview4
                    
#r "nuget: Sentry, 0.0.1-preview4"
                    
#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 Sentry@0.0.1-preview4
                    
#: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=Sentry&version=0.0.1-preview4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sentry&version=0.0.1-preview4&prerelease
                    
Install as a Cake Tool

Below you will find a basic introduction to the SDK and its API.

For more details, please: refer to the SDK documentation

Main features

  • Automatic Captures global unhandled exceptions (AppDomain)
  • Scope management
  • Duplicate events automatically dropped
  • Events from the same exception automatically dropped
  • Web proxy support
  • Compress request body
  • Event flooding protection (429 retry-after and internal bound queue)
  • DSN discovered via environment variable
  • Release (version) reported automatically
  • CLS Compliant
  • Strong named
  • SourceLink (including PDB in nuget package)
  • Device OS info sent
  • Device Runtime info sent
  • Tested on Windows, Linux and macOS
  • Tested on .NET Core, .NET Framework and Mono

Basics

Initialize the SDK:

void Main() 
{
    using (SentrySdk.Init("dsn"))
    {
        // App code
    }
}

The SDK by default will watch for unhandled exceptions in your app. If the DSN is not explicitly passed by parameter to Init, the SDK will try to locate it via environment variable SENTRY_DSN.

To configure advanced settings, for example a proxy server:

void Main() 
{
    using (SentrySdk.Init(o =>
    {
        o.Dsn = new Dsn("dsn");
        o.Http(h =>
        {
            h.Proxy = new WebProxy("https://localhost:3128");
        });
    }))
    {
        // App code
    }
}

Capture an exception:

try
{
    throw null;
}
catch (Exception e)
{
    SentrySdk.CaptureException(e);
}

Capture a message:

SentrySdk.CaptureMessage("this just happened");

Internals/Testability

It's often the case we don't want to couple our code with static class like SentrySdk, especially to allow our code to be testable. If that's your case, you can use 2 abstractions:

  • ISentryClient
  • IHub

The ISentryClient is responsible to queueing the event to be sent to Sentry and abstracting away the internal transport. The IHub on the other hand, holds a client and the current scope. It in fact also implements ISentryClient and is able to dispatch calls to the right client depending on the current scope.

In order to allow different events hold different contextual data, you need to know in which scope you are in. That's the job of the Hub. It holds the scope management as well as a client.

If all you are doing is sending events, without modification/access to the current scope, then you depend on ISentryClient. If on the other hand you would like to have access to the current scope by configuring it or binding a different client to it, etc. You'd depend on IHub.

An example using IHub for testability is SentryLogger and its unit tests SentryLoggerTests.
SentryLogger depends on IHub because it does modify the scope (through AddBreadcrumb). In case it only sent events, it should instead depend on ISentryClient

Compatibility

The packages target .NET Standard 2.0. That means it is compatible with the following versions or newer:

  • .NET Framework 4.6.1
  • .NET Core 2.0
  • Mono 5.4
  • Xamarin.Android 8.0
  • Xamarin.Mac 3.8
  • Xamarin.iOS 10.14
  • Universal Windows Platform 10.0.16299

Of those, we've tested (we run our unit/integration tests) against:

  • .NET Framework 4.6.2 on Windows (AppVeyor)
  • Mono 5.12 macOS and Linux (Travis-CI)
  • .NET Core 2.0 Windows (AppVeyor), macOS and Linux (Travis-CI)
  • .NET Core 2.1 Windows (AppVeyor), macOS and Linux (Travis-CI)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (87)

Showing the top 5 NuGet packages that depend on Sentry:

Package Downloads
Sentry.Extensions.Logging

Official Microsoft.Extensions.Logging integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.

Sentry.Serilog

Official Serilog integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.

Sentry.NLog

Official NLog integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.

Sentry.DiagnosticSource

Official Diagnostic.Listener integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time. Note: This package is not needed when using Sentry with .NET Core 3 or higher.

Sentry.EntityFramework

Official Entity Framework 6 integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.

GitHub repositories (68)

Showing the top 20 popular GitHub repositories that depend on Sentry:

Repository Stars
files-community/Files
A modern file manager that helps users organize their files and folders.
ppy/osu
rhythm is just a *click* away!
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
1Remote/1Remote
One Remote Access Manager to Rule Them All
Prowlarr/Prowlarr
Prowlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps, supporting management of both Torrent Trackers and Usenet Indexers.
Lidarr/Lidarr
Looks and smells like Sonarr but made for music.
timschneeb/GalaxyBudsClient
Unofficial Galaxy Buds Manager for Windows, macOS, Linux, and Android
BililiveRecorder/BililiveRecorder
录播姬 | mikufans 生放送录制
DearVa/Everywhere
A context-aware AI assistant for your desktop. Ready to respond intelligently, seamlessly integrating multiple LLMs and MCP tools.
tixl3d/tixl
TiXL is an open source software to create realtime motion graphics.
Readarr/Readarr
Book Manager and Automation (Sonarr for Ebooks)
Facepunch/sbox-public
s&box is a modern game engine, built on Valve's Source 2 and the latest .NET technology, it provides a modern intuitive editor for creating games
bombomby/optick
C++ Profiler For Games
huynhsontung/Screenbox
LibVLC-based media player for the Universal Windows Platform
ProtonVPN/win-app
Official ProtonVPN Windows app
ClassIsland/ClassIsland
一款功能强、可定制、跨平台,适用于班级多媒体屏幕的课表信息显示工具,可以一目了然地显示各种信息。
MCCTeam/Minecraft-Console-Client
Lightweight console for Minecraft chat and automated scripts
CollapseLauncher/Collapse
An Advanced Launcher for miHoYo/HoYoverse Games
Version Downloads Last Updated
6.0.0 3,610 12/11/2025
6.0.0-rc.2-prerelease 4,308 11/25/2025
6.0.0-rc.1-prerelease 6,185 11/17/2025
6.0.0-preview.2-prerelease 2,962 10/30/2025
6.0.0-preview.1-prerelease 3,840 10/6/2025
5.16.2 425,048 10/31/2025
5.16.1 269,950 10/14/2025
5.16.0 225,161 10/1/2025
5.15.1 253,030 9/20/2025
5.15.1-maxpath.1 4,061 9/18/2025
5.15.0 172,379 9/11/2025
5.14.1 626,145 8/14/2025
5.14.0 102,531 8/8/2025
5.14.0-alpha.1 379 8/6/2025
5.14.0-alpha.0 377 8/5/2025
5.13.0 256,412 7/28/2025
5.12.0 259,302 7/15/2025
5.12.0-alpha.0 2,109 7/11/2025
5.11.2 630,435 6/25/2025
5.11.1 70,297 6/21/2025
5.11.0 38,164 6/19/2025
5.11.0-alpha.3 992 6/13/2025
5.11.0-alpha.1 1,716 6/7/2025
5.10.0 393,446 6/6/2025
5.9.0 116,670 5/30/2025
5.8.2-beta.1 182 5/29/2025
5.8.1 72,014 5/27/2025
5.8.0 221,192 5/21/2025
5.8.0-alpha.0 196 5/22/2025
5.7.0 208,857 5/13/2025
5.7.0-beta.0 2,245 5/2/2025
5.6.0 470,479 4/24/2025
5.5.1 623,150 4/8/2025
5.5.0 163,188 4/2/2025
5.4.0 587,223 3/15/2025
5.3.0 339,836 3/7/2025
5.2.0 366,085 2/26/2025
5.1.1 578,582 2/13/2025
5.1.0 747,996 2/3/2025
5.0.1 3,323,962 1/8/2025
5.0.0 1,248,273 12/19/2024
5.0.0-alpha.1 26,496 11/25/2024
5.0.0-alpha.0 260 11/24/2024
4.13.0 2,895,802 11/5/2024
4.12.2 132,891 11/2/2024
4.12.1 1,233,874 10/10/2024
4.12.1-segv1 1,166 11/1/2024
4.12.0 439,571 10/2/2024
4.11.0 964,979 9/22/2024
4.10.2 1,969,375 8/21/2024
4.10.1 305,953 8/16/2024
4.10.0 84,672 8/14/2024
4.9.0 1,699,347 7/11/2024
4.9.0-sync.collection.2 411 7/30/2024
4.9.0-sync.collection.1 217 7/30/2024
4.8.1 515,640 7/2/2024
4.8.0 368,474 6/26/2024
4.7.0 1,513,681 5/27/2024 4.7.0 is deprecated.
4.6.2 570,614 5/14/2024 4.6.2 is deprecated.
4.6.0 134,226 5/9/2024 4.6.0 is deprecated.
4.5.0 455,534 4/30/2024 4.5.0 is deprecated.
4.4.0 801,553 4/12/2024 4.4.0 is deprecated.
4.3.0 238,043 4/10/2024 4.3.0 is deprecated.
4.2.1 1,152,144 3/12/2024 4.2.1 is deprecated.
4.2.0 52,366 3/11/2024 4.2.0 is deprecated.
4.1.2 1,510,906 2/20/2024 4.1.2 is deprecated.
4.1.1 256,837 2/14/2024 4.1.1 is deprecated.
4.1.0 217,564 2/9/2024 4.1.0 is deprecated.
4.0.3 102,416 2/7/2024 4.0.3 is deprecated.
4.0.2 161,415 2/6/2024 4.0.2 is deprecated.
4.0.1 49,079 2/5/2024 4.0.1 is deprecated.
4.0.0 155,241 2/1/2024 4.0.0 is deprecated.
4.0.0-beta.9 1,243 1/30/2024
4.0.0-beta.8 18,563 1/11/2024
4.0.0-beta.7 8,055 1/5/2024
4.0.0-beta.6 25,875 12/13/2023
4.0.0-beta.5 2,625 12/12/2023
4.0.0-beta.4 26,216 12/5/2023
4.0.0-beta.3 692 12/2/2023
4.0.0-beta.2 5,019 11/23/2023
4.0.0-beta.1 1,144 11/19/2023
4.0.0-beta.0 695 11/17/2023
4.0.0-alpha.0 10,336 11/9/2023
3.41.4 1,786,467 1/23/2024
3.41.3 2,073,826 11/29/2023
3.41.2 400,754 11/23/2023
3.41.1 107,778 11/22/2023
3.41.0 1,028,015 11/8/2023
3.40.1 943,468 10/12/2023
3.40.0 151,636 10/10/2023
3.40.0-beta.0 17,409 9/21/2023
3.39.1 2,746,508 9/12/2023
3.39.0 266,482 9/7/2023
3.36.0 742,491 8/22/2023
3.35.1 272,583 8/16/2023
3.35.0 189,042 8/8/2023 3.35.0 is deprecated.
3.34.0 1,470,346 7/13/2023
3.33.1 1,493,230 6/13/2023
3.33.0 1,355,284 5/22/2023
3.32.0 29,966 5/22/2023
3.31.0 911,154 5/2/2023
3.30.0 1,280,698 4/11/2023
3.29.1 1,945,316 3/11/2023
3.29.0 297,213 3/6/2023
3.28.1 1,497,034 2/10/2023
3.28.0 94,925 2/8/2023
3.27.1 380,074 2/3/2023
3.27.0 157,573 2/1/2023
3.26.2 930,194 1/24/2023
3.26.1 328,625 1/17/2023
3.26.0 404,324 1/13/2023
3.25.0 1,407,769 12/23/2022
3.24.1 430,636 12/16/2022
3.24.0 2,154,965 11/18/2022
3.23.1 974,578 10/31/2022
3.23.0 104,549 10/27/2022
3.22.0 1,705,989 10/7/2022
3.21.0 1,957,982 9/2/2022
3.20.1 1,908,690 7/26/2022
3.19.0 1,029,544 6/28/2022
3.18.0 661,656 6/15/2022
3.17.1 1,607,781 5/8/2022
3.17.0 152,844 5/3/2022
3.16.0 1,024,243 4/7/2022
3.15.0 1,073,770 3/15/2022
3.14.1 958,121 2/18/2022
3.14.0 223,358 2/14/2022
3.13.0 1,576,730 1/11/2022
3.12.3 1,180,079 12/19/2021
3.12.2 98,794 12/15/2021
3.12.1 407,454 12/6/2021
3.12.0 315,162 11/23/2021
3.12.0-alpha.1 6,367 11/7/2021
3.11.1 758,105 11/5/2021
3.11.0 193,047 11/2/2021
3.10.0 729,329 10/15/2021
3.9.4 1,203,129 9/29/2021
3.9.3 180,773 9/21/2021
3.9.2 261,204 9/10/2021
3.9.1 16,321 9/9/2021
3.9.0 330,464 8/27/2021
3.8.3 943,877 7/25/2021
3.8.2 144,130 7/17/2021
3.8.1 28,255 7/15/2021
3.8.0 133,710 7/14/2021
3.7.0 151,852 7/10/2021
3.6.1 195,000 7/2/2021
3.6.0 257,700 6/23/2021
3.6.0-alpha.2 826 6/18/2021
3.6.0-alpha.1 1,446 6/11/2021
3.5.0 501,034 6/7/2021 3.5.0 is deprecated because it has critical bugs.
3.4.0 158,174 5/31/2021 3.4.0 is deprecated because it has critical bugs.
3.4.0-beta.0 605 5/27/2021 3.4.0-beta.0 is deprecated because it has critical bugs.
3.3.5-beta.0 2,759 5/13/2021
3.3.4 817,828 4/26/2021
3.3.3 9,579 4/23/2021
3.3.2 25,124 4/23/2021
3.3.1 589,937 4/5/2021
3.3.0 35,492 4/3/2021
3.2.0 140,220 3/26/2021
3.1.0 401,836 3/10/2021
3.0.8 74,009 3/4/2021
3.0.7 254,502 2/20/2021
3.0.6 108,012 2/14/2021
3.0.5 75,860 2/9/2021
3.0.4 32,688 2/8/2021
3.0.3 81,968 2/3/2021
3.0.2 28,456 2/3/2021
3.0.1 150,762 1/29/2021
3.0.0 58,506 1/28/2021
3.0.0-beta.0 11,845 1/20/2021
3.0.0-alpha.11 694 1/15/2021
3.0.0-alpha.10 66,156 1/10/2021
3.0.0-alpha.9 2,459 12/29/2020
3.0.0-alpha.8 4,757 12/25/2020
3.0.0-alpha.7 3,206 12/16/2020
3.0.0-alpha.6 4,010 11/30/2020
3.0.0-alpha.5 3,505 11/21/2020
3.0.0-alpha.4 2,685 11/2/2020
3.0.0-alpha.3 2,094 10/29/2020
3.0.0-alpha.2 1,055 10/21/2020
3.0.0-alpha.1 6,384 10/16/2020
3.0.0-alpha.0 2,514 9/25/2020
2.2.0-alpha 3,319 9/19/2020
2.1.8 2,271,516 11/21/2020
2.1.6 2,226,113 8/20/2020
2.1.5 642,753 7/27/2020
2.1.5-beta 4,588 6/30/2020
2.1.4 654,250 6/25/2020
2.1.3 729,063 6/5/2020
2.1.2-beta5 8,308 5/19/2020
2.1.2-beta4 5,271 5/12/2020
2.1.2-beta3 2,451 5/7/2020
2.1.2-beta2 22,659 4/16/2020
2.1.2-beta 4,757 3/31/2020
2.1.1 1,688,544 3/19/2020
2.1.0 781,355 2/24/2020
2.0.3 607,902 2/12/2020
2.0.2 36,795 2/8/2020
2.0.1 298,838 1/28/2020
2.0.0-beta8 24,556 1/15/2020
2.0.0-beta7 168,673 12/17/2019
2.0.0-beta6 103,654 10/31/2019
2.0.0-beta5 7,679 10/29/2019
2.0.0-beta4 76,489 9/4/2019
2.0.0-beta3 17,555 7/26/2019
2.0.0-beta2 6,704 6/9/2019
2.0.0-beta 3,697 6/4/2019
1.2.1-beta 2,779 5/27/2019
1.2.0 3,259,017 5/23/2019
1.1.3-beta4 2,370 5/15/2019
1.1.3-beta3 2,138 5/13/2019
1.1.3-beta2 8,610 3/28/2019
1.1.3-beta 5,757 2/11/2019
1.1.2 660,325 1/16/2019
1.1.2-beta 3,911 1/8/2019
1.1.1 24,971 1/5/2019
1.1.0 125,215 12/5/2018
1.0.1-beta5 3,054 12/5/2018
1.0.1-beta4 3,772 12/3/2018
1.0.1-beta3 18,915 11/15/2018
1.0.1-beta2 3,659 11/14/2018
1.0.1-beta 21,745 10/24/2018
1.0.0 322,403 10/2/2018
1.0.0-rc2 25,200 9/7/2018
1.0.0-rc 6,287 8/24/2018
0.0.1-preview5 8,025 8/5/2018
0.0.1-preview4 5,556 7/30/2018
0.0.1-preview3 7,294 7/17/2018
0.0.1-preview2 6,662 7/3/2018
0.0.1-preview1 3,077 6/28/2018