-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Sentry assembly produces trim warnings when compiling AOT #3304
Comments
This happened sporadically and was not 100% reproducible? |
This happens when using NativeAOT in an iOS or macOS app while |
An example would be super appreciated! |
Here's the example project: test_macos.zip |
Thanks @tipa, We can reliably reproduce this by enabling trimming on the Sentry.Samples.Console.Basic project per the docs. There are two problems. MiscExtensionsThe We could:
WinUIUnhandledExceptionIntegrationFor this one, the issue is here: sentry-dotnet/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs Lines 112 to 113 in 83d8b4e
Here I think we've used reflection to avoid creating a dependency on WinUI stuff in the core Sentry nuget package. We could:
|
Steps to reproduce
Now publish the application again.
Expected Result
Application should publish without warnings.
Actual Result
The application is published correctly but the publish operation generates trim warnings:
Remarks
This is very odd as we explicitly set the
IsAotCompatible
MS Build property which should setIsTrimmable
and enable the trim analyzer as well:sentry-dotnet/src/Sentry/Sentry.csproj
Lines 27 to 29 in 4b33c36
If there are any trim warnings then, we should be getting these when building Sentry for the net8.0 targets.
The text was updated successfully, but these errors were encountered: