liveBook · Manning

Trimming

As explained in Building Web APIs with ASP.NET Core

A deployment optimization technique that removes unused assemblies, types, and members from an application package.

Trimming reduces a .NET deployment package by removing assemblies unused by the application, then removing unused types and members within retained assemblies. section 12.1.5

Use trimming to manage deployment-size trade-offs:

  • Reduce the disk-space cost of self-contained applications, especially when deploying multiple applications to one hosting server. section 12.1.5
  • Balance smaller packages against publishing choices based on server control, available runtime packages, hardware, disk space, and memory. section 12.1.5

Multiple self-contained applications

A hosting server running several self-contained .NET applications can use trimming to reduce the repeated disk-space cost of bundled runtime resources and application libraries. section 12.1.5

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Explains assembly, type, and member removal but does not detail configuration steps or trimming compatibility issues.
Examples
Uses multiple self-contained applications on one hosting server to illustrate cumulative disk-space savings.
What you can do after
Evaluate deployment-size trade-offs when choosing a .NET publishing mode.
How it connects
Connects self-contained deployment, framework-dependent deployment, .NET runtime packaging, and assemblies.

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.