# C# Error Tracking and Performance Monitoring

> Our C# error & performance monitoring helps developers diagnose, fix & optimize the performance of their code. Get started with Sentry for free today.

**URL:** https://sentry.io/for/csharp/

---

**Documentation:** [https://docs.sentry.io/platforms/dotnet/](https://docs.sentry.io/platforms/dotnet/)

## Install

Install the **NuGet** package to add the Sentry dependency:

```bash
dotnet add package Sentry
```

Initialize the SDK as early as possible, like in the `Main` method in `Program.cs/Program.fs`:

```csharp
using (SentrySdk.Init(o => {
  // Tells which project in Sentry to send events to:
  o.Dsn = "https://<key>@sentry.io/<project>";
  // When configuring for the first time, to see what the SDK is doing:
  o.Debug = true;
  // Set TracesSampleRate to 1.0 to capture 100% of transactions for Tracing.
  // We recommend adjusting this value in production.
  o.TracesSampleRate = 1.0; }))
{
  // App code goes here - Disposing will flush events out
}
```

See the [C# docs](https://docs.sentry.io/platforms/dotnet/) for full setup options.

## Features

### C# Error Monitoring with Complete Stack Traces

See C# stack trace details like filename and line number so you never have to guess. Filter and group C# exceptions intuitively to eliminate noise. Monitor errors at scale without impacting throughput in production.

### C# Performance Monitoring

Quickly identify C# performance issues before they become downtime with [performance monitoring](/for/performance/). View the entire end-to-end distributed trace to see the exact, poor-performing API call and surface any related errors.

### Fill In The Blanks About C# Errors

Expose the important events that led to each C# exception: debug logs, network requests, database queries, past errors.

### See the Full Picture of Any C# Exception

With Sentry's exceptional exception handling in C#, you can triage quickly based on specific parameters like HTTP request, workflow stage, and hostname for each issue. Set custom tags to recreate the error environment relevant to your app, business concerns, and users.

---

*Source: [sentry.io/for/csharp/](https://sentry.io/for/csharp/)*
