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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
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
1 change: 0 additions & 1 deletion .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ runs:
brew link --overwrite mono

- name: Install .NET SDK
if: runner.os != 'Windows'
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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))
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test that repros this crash, so we make sure this PR fixes it?


### 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