Skip to content

Update the MAUI sample to CSLA 11 with trimming and NativeAOT #4970

Open

Description

@rockfordlhotka

Background

CSLA 11 makes the framework, including Csla.Xaml for MAUI, trim and NativeAOT compatible (#3347, #4955, #4962). Samples/MauiExample still targets CSLA 10 packages and doesn't publish with trimming or NativeAOT, so it doesn't show how to build a MAUI app on CSLA 11 that does.

This issue covers the trimming and NativeAOT part of moving the MAUI sample to CSLA 11. The general sample changes, such as the RefreshAsync updates and the #1766 view model behavior changes, are tracked in #4961.

Work

  1. Move to CSLA 11 packages. BusinessLibrary references Csla and the retired Csla.Generator.AutoImplementProperties.CSharp 10.0.0 beta, and MauiExample references Csla.Maui 10.0.0 beta. Remove the generator package (it fails the build with CSLABUILD001 in CSLA 11) and reference the CSLA 11 Csla and Csla.Maui packages. This depends on a published Csla 11 package and on Add MAUI support for version 11 #4924.
  2. Business classes.
    • Declare PersonList partial (CSLA0024), so the operations generator handles its data portal methods.
    • Replace Csla.Data.DataMapper.Map(data, this) in PersonEdit with explicit property assignments. DataMapper.Map is [RequiresUnreferencedCode].
  3. Publish with trimming and NativeAOT.
    • Enable full trimming (TrimMode=full) for Android and iOS.
    • Enable NativeAOT where MAUI supports it (PublishAot on iOS and Mac Catalyst).
    • Set TrimmerSingleWarn=false so warnings are reported per member.
    • Set IsAotCompatible on BusinessLibrary and DataAccess, so they are analyzed at build time.
    • Remove the stale net9.0 property groups from MauiExample.csproj.
  4. Get to zero IL warnings.
    • PersonEditPage.xaml uses csla:PropertyInfo, which CSLA 11 marks [RequiresUnreferencedCode] because it walks a string binding path. Decide whether the sample keeps it and documents the warning (the binding source is a business object, so it is preserved), or shows an alternative.
    • Keep compiled bindings (x:DataType) everywhere.
  5. Verify. Publish a Release build for at least Android and one Apple target with NativeAOT. Then run the app and exercise list, edit, save and validation.
  6. Readme. Update the sample's readme with the project settings and the CSLA-specific rules.

References

Activity

  1. added 5 commits that reference this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions