aspnet / Announcements

Subscribe to this repo to be notified about major changes in ASP.NET Core and Entity Framework Core
Other
1.66k stars 80 forks source link

[Breaking change]: TrimMode defaults to `full` for WebSDK projects #507

Open captainsafia opened 1 year ago

captainsafia commented 1 year ago

Description

Trimming now trims all assemblies in applications targeting the Web SDK, by default. This change only affects apps that are published with PublishTrimmed=true, and it only breaks apps that had existing trim warnings.

Version

.NET 8 Preview 7

Previous behavior

Previously, TrimMode=partial was set by default for all projects that targeted the WebSDK.

New behavior

Starting in .NET 8 Preview 7, trimming trims all the assemblies in the app by default. Apps that may have previously worked with PublishTrimmed=true and TrimMode=partial may not work in .NET 8 Preview 7. However, only apps with trim warnings will be affected. If your app has no trim warnings, the change in behavior should not cause any adverse effect.

Type of breaking change

Reason for change

This change helps to decrease app size without users having to explicitly opt in and aligns with user expectations that the entire app is trimmed unless noted otherwise.

Recommended action

The best resolution is to resolve all the trim warnings in your application. For information about resolving the warnings in your own libraries, see Introduction to trim warnings.

To revert to the previous behavior, set the TrimMode property to partial.

<TrimMode>partial</TrimMode>

Affected APIs

None.