sentry-dotnet
sentry-dotnet copied to clipboard
Consider alternative to ObsoleteAttribute on GetInternalSentryOptions
Description
This is a bit of a misuse of the ObsoleteAttribute:
https://github.com/getsentry/sentry-dotnet/blob/216bbc597a167f9d26216f968b9fc21cbff99a54/src/Sentry/SentryClientExtensions.cs#L98-L110
We could potentially replace it with this:
[InternalApi("For internal integrations like Hangfire only")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static SentryOptions? GetInternalSentryOptions(this ISentryClient clientOrHub) =>
clientOrHub.GetSentryOptions();
And then also ship a Roslyn Analyzer that warns if people use something decorated with InternalApiAttribute.
See also
- https://github.com/getsentry/sentry-dotnet/pull/4619#discussion_r2432364301