Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions platform-includes/configuration/config-intro/dotnet.aspnetcore.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Options can be set by passing a callback to the `UseSentry()` method which will
pass the option object along for modifications:

ASP.NET Core 6.0+:
### ASP.NET Core 6.0+:

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand All @@ -25,39 +25,9 @@ builder.WebHost.UseSentry(fun o ->
) |> ignore
```

ASP.NET Core 3.0:
### ASP.NET Core 2.3 on .NET Framework:

```csharp
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
// Add the following line:
webBuilder.UseSentry(o =>
{
o.Dsn = "___PUBLIC_DSN___";
o.MaxBreadcrumbs = 50;
o.Debug = true;
o.SendDefaultPii = true;
});
});
```

```fsharp
let CreateHostBuilder args =
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(fun webBuilder ->
// Add the following line:
webBuilder.UseSentry(fun o ->
o.Dsn <- "___PUBLIC_DSN___"
o.MaxBreadcrumbs <- 50
o.Debug <- true
o.SendDefaultPii <- true
) |> ignore
)
```

ASP.NET Core 2.x:
Although ASP.NET Core 2 is no longer supported for .NET Core, Microsoft maintain ASP.NET Core 2.3 to make it easier for people using .NET Framework to transition to ASP.NET Core. If you are using [ASP.NET Core 2.3 on .NET Framework](https://dotnet.microsoft.com/en-us/platform/support/policy/aspnet#dotnet-core) then you can configure Sentry using the `WebHostBuilder`:

```csharp
public static IWebHost BuildWebHost(string[] args) =>
Expand Down
25 changes: 3 additions & 22 deletions platform-includes/getting-started-config/dotnet.aspnetcore.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Add Sentry to `Program.cs` through the `WebApplicationBuilder`:

ASP.NET Core 6.0+:
### ASP.NET Core 6.0+:

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand All @@ -14,28 +14,9 @@ let builder = WebApplication.CreateBuilder(args)
builder.WebHost.UseSentry("___PUBLIC_DSN___") |> ignore
```

ASP.NET Core 3.0:
### ASP.NET Core 2.3 on .NET Framework:

```csharp
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
// Add the following line:
webBuilder.UseSentry("___PUBLIC_DSN___");
});
```

```fsharp
let CreateHostBuilder args =
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(fun webBuilder ->
// Add the following line:
webBuilder.UseSentry("___PUBLIC_DSN___") |> ignore
)
```

ASP.NET Core 2.x:
Although ASP.NET Core 2 is no longer supported for .NET Core, Microsoft maintain ASP.NET Core 2.3 to make it easier for people using .NET Framework to transition to ASP.NET Core. If you are using [ASP.NET Core 2.3 on .NET Framework](https://dotnet.microsoft.com/en-us/platform/support/policy/aspnet#dotnet-core) then you can configure Sentry using the `WebHostBuilder`:

```csharp
public static IWebHost BuildWebHost(string[] args) =>
Expand Down
Loading