iOS:
Depending on the value of MTouchLink (and LinkMode for macOS projects), we set the corresponding TrimMode value(s) to get the same behavior. If a TrimMode value is set, that takes precedence over MTouchLink/LinkMode.
We should add [assembly: AssemblyMetadata ("IsTrimmable", "False")] for MAUI assemblies that don't support trimming.
Note that in .NET 7 the default (for non-Apple workloads, because we override the default) is to trim assemblies unless they have that attribute (the default in .NET 6 was to only trim assemblies that had the attribute set to "True"). This means that in .NET 7 your assemblies will get trimmed unless they set the attribute (again, this does not apply to Apple workloads, because we override the default, and our default has not changed).
iOS:
Depending on the value of MTouchLink (and LinkMode for macOS projects), we set the corresponding TrimMode value(s) to get the same behavior. If a TrimMode value is set, that takes precedence over MTouchLink/LinkMode.
We should add
[assembly: AssemblyMetadata ("IsTrimmable", "False")]for MAUI assemblies that don't support trimming.Note that in .NET 7 the default (for non-Apple workloads, because we override the default) is to trim assemblies unless they have that attribute (the default in .NET 6 was to only trim assemblies that had the attribute set to "True"). This means that in .NET 7 your assemblies will get trimmed unless they set the attribute (again, this does not apply to Apple workloads, because we override the default, and our default has not changed).