[net9.0] Updating the project to .NET9 and trim/AOT compatibilty #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the app to .NET9, but more importantly, it makes necessary changes to achieve AOT/trim compatibility making the app compatible with NativeAOT (and in general
TrimMode=Full
mode) when targeting iOS platforms.Initial state
The app initially produced 124 warnings (list of warnings: https://gist.github.com/ivanpovazan/8349040163c30f481b4d4f48ceb301a6) , due to the fact that it did not use:
When doing the code review, you can follow the commit history as I was fixing each warning group one-by-one.
Current state
When using dotnet SDK:
9.0.100-preview.3.24204.13
and MAUI version:
9.0.0-preview.3.10457/9.0.100-preview.3
The app produces 9 warnings, where all of the warnings come from the framework it self:
When using the MAUI at: dotnet/maui@000f24b
The app produces 1 warning:
Testing
I tested the app on iOS device with both runtimes:
dotnet publish -f net9.0-ios -r ios-arm64 -p:TrimmerSingleWarn=false -t:Run
dotnet publish -f net9.0-ios -r ios-arm64 -p:TrimmerSingleWarn=false -p:PublishAot=true -p:PublishAotUsingRuntimePack=true -t:Run
Final note
I marked the PR as
DRAFT
as I am not that familiar with the code it self, but tried to adapt it to get rid of all the trim warnings, so please take that into account when doing the review.The goal is to reach 0 warnings and verify the app functionality (manually or through automated UI testing).
Size perf
NOTE: For
NativeAOT opt
measurements the following optimization options were used-p:StackTraceSupport=false
-p:OptimizationPreference=Size
/cc: @PureWeen @simonrozsival