Remove Application.Properties implementation #4976
Merged
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.
The Application.Properties and SavePropertiesAsync APIs bring in a dependency
on
DataContractSerializer
in a default application. This, in turn, bringsin a lot of the System.Xml code by default.
Since these APIs are already marked as obsolete, and the recommendation is to use
the corresponding Essentials APIs, remove the implementation of these APIs and
instead throw an exception. This will allow for
DataContractSerializer
to beremoved in a default app.
From my local testing this removes 855 KB of IL in a
dotnet new maui
Androidapplication.
Before: 10.9 MB (11,431,696 bytes)
After: 10.0 MB (10,556,176 bytes)
And it cuts 1 MB out of a published
dotnet new maui
iOS application .ipa size.Before: 18.0 MB (18,918,198 bytes)
After: 17.0 MB (17,850,723 bytes)
Fix #4864