getsentry / getsentry/sentry-dotnet

IWebHostBuilder extensions register multiple `IConfigureOptions<SentryAspNetCoreOptions>`

Open
#3,906 0 comments 0 reactions 0 assignees View on GitHub
.NET Framework: ASP.NET Core Improvement
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

When using the `IWebHostBuilder` extensions to configure Sentry in ASP.NET Core, three separate `IConfigureOptions` instances are registered with the Services collection.

I think at least one of these is redundant.

### Registration 1
https://github.com/getsentry/sentry-dotnet/blob/24c159fac119315e21df6138dc04bfe3ccd573c2/src/Sentry.AspNetCore/SentryWebHostBuilderExtensions.cs#L89-L91

### Registration 2
https://github.com/getsentry/sentry-dotnet/blob/24c159fac119315e21df6138dc04bfe3ccd573c2/src/Sentry.AspNetCore/SentryWebHostBuilderExtensions.cs#L93-L94

### Registration 3

https://github.com/getsentry/sentry-dotnet/blob/24c159fac119315e21df6138dc04bfe3ccd573c2/src/Sentry.AspNetCore/SentryWebHostBuilderExtensions.cs#L52-L56

https://github.com/getsentry/sentry-dotnet/blob/e75d537c14ded617c99eb33f19cf4ce69ca4de36/src/Sentry.AspNetCore/SentryBuilderExtensions.cs#L21

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.