Skip to content

Add IsTrimmable=False attribute to non-trimmable assemblies #9816

@Redth

Description

@Redth

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).

Metadata

Metadata

Labels

area-publishingIssues with the app packaging/publishing process (ipk/apk/msix/trimming)fixed-in-7.0.49Look for this fix in 7.0.49 GA!perf/app-sizeApplication Size / Trimming (sub: perf)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions