.NET
This section will describe features, configurations and general functionality which are specific to the .NET SDK.
ASP.NET
ASP.NET Core
Entity Framework
Microsoft.Extensions.Logging
log4net
NLog
Serilog
Windows Forms
Windows Presentation Foundation
Compatibility
The main Sentry NuGet package targets .NET Standard 2.0. That means, according to the compatibility table, it is compatible with the following versions or newer:
- .NET Framework 4.6.1 (4.7.2 advised)
- .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 run our unit/integration tests against:
- .NET Framework 4.8 on Windows
- Mono 5.12 macOS and Linux
- .NET Core 2.1 Windows, macOS and Linux
- .NET Core 3.1 Windows, macOS and Linux
Using an older version of .NET Framework or Mono?
Our legacy SDK supports .NET Framework as early as 3.5.
Install
Add the Sentry dependency:
Copied
Install-Package Sentry -Version 2.1.6Configure
Initialize the SDK as early as possible, like in the Main method in Program.cs:
Program.csCopied
using (SentrySdk.Init("https://examplePublicKey@o0.ingest.sentry.io/0"))
{
// App code
}Verify
Verify Sentry is capturing unhandled exceptions by raising an exception. For example, you can use the following snippet to raise a DivideByZeroException:
Copied
using (SentrySdk.Init("https://examplePublicKey@o0.ingest.sentry.io/0"))
{
Console.WriteLine(1 / 0);
}Resources
You can edit this page on GitHub.
- Package:
- nuget:Sentry
- Version:
- 2.1.6
- Repository:
- https://github.com/getsentry/sentry-dotnet