Skip to content

Commit f934549

Browse files
authored
Clarify build configs and full trimming (#2688)
* Clarify build configs and full trimming. * Edit.
1 parent 14ef342 commit f934549

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/deployment/trimming.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Trimming behavior can be controlled by setting the `$(TrimMode)` build property
2323
```
2424

2525
> [!IMPORTANT]
26-
> The `$(TrimMode)` build property shouldn't be conditioned by build configuration. This is because features switches are enabled or disabled based on the value of the `$(TrimMode)` build property, and the same features should be enabled or disabled in all build configurations so that your code behaves identically.
26+
> Don't set the `$(TrimMode)` build property when using Native AOT deployment, which automatically performs full trimming of your app. For more information, see [Native AOT deployment on iOS and Mac Catalyst](nativeaot.md).
2727
2828
The `full` trim mode removes any code that's not used by your app. The `partial` trim mode trims the base class library (BCL), assemblies for the underlying platforms (such as *Mono.Android.dll* and *Microsoft.iOS.dll*), and any other assemblies that have opted into trimming with the `$(TrimmableAsssembly)` build item:
2929

@@ -35,10 +35,10 @@ The `full` trim mode removes any code that's not used by your app. The `partial`
3535

3636
This is equivalent to setting `[AssemblyMetadata("IsTrimmable", "True")]` when building the assembly.
3737

38-
In a .NET MAUI app, it's not necessary to set the `$(PublishTrimmed)` build property to `true` in your app's project file, because this is set by default.
38+
Full trimming shouldn't be conditioned by build configuration. This is because features switches are enabled or disabled based on the value of the `$(TrimMode)` build property, and the same features should be enabled or disabled in all build configurations so that your code behaves identically.
3939

4040
> [!NOTE]
41-
> Don't set the `$(TrimMode)` build property when using Native AOT deployment. Native AOT deployment automatically performs full trimming of your app. For more information, see [Native AOT deployment on iOS and Mac Catalyst](nativeaot.md).
41+
> In a .NET MAUI app, it's not necessary to set the `$(PublishTrimmed)` build property to `true` in your app's project file, because this is set by default.
4242
4343
For more trimming options, see [Trimming options](/dotnet/core/deploying/trimming/trimming-options).
4444

0 commit comments

Comments
 (0)