Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Release Builds with Trimming enabled crashing on launch with NLog Integration #3743

Merged
merged 9 commits into from
Nov 20, 2024
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

### Fixes

- Fixed ArgumentNullException in FormRequestPayloadExtractor when handling invalid form data on ASP.NET ([#3734](https://github.com/getsentry/sentry-dotnet/pull/3734))
- ArgumentNullException in FormRequestPayloadExtractor when handling invalid form data on ASP.NET ([#3734](https://github.com/getsentry/sentry-dotnet/pull/3734))
- Crash when using NLog with FailedRequestStatusCodes options in a Maui app with Trimming enabled ([#3743](https://github.com/getsentry/sentry-dotnet/pull/3743))
jamescrosswell marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

@bruno-garcia bruno-garcia Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAUI is all caps. Maui is a city in Hawaii


### Dependencies

Expand Down
6 changes: 5 additions & 1 deletion src/Sentry.NLog/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ public static LoggingConfiguration AddSentry(

optionsConfig?.Invoke(options);

LogManager.Setup().SetupExtensions(e => e.RegisterTarget<SentryTarget>("Sentry"));
LogManager.Setup().SetupExtensions(e =>
{
e.RegisterTarget<SentryTarget>("Sentry");
e.RegisterType<SentryNLogOptions>();
});

var target = new SentryTarget(options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.NLog/Sentry.NLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="5.0.5" />
<PackageReference Include="NLog" Version="5.2.4" />
bricefriha marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down
Loading