Skip to content

Developers can safely trim ASP.NET apps to reduce their deployment payloads #27384

@mkArtakMSFT

Description

@mkArtakMSFT

Summary

This is a big effort to help with better trimming of the library with the goal of reducing the size of a published app.
There are some design choices we've made which make it hard to trim unused code (broadly, anything that uses reflection)
As part of this effort those designs should be reviewed to see whether we can find better alternatives.

People with more context

@davidfowl, @halter73, @javiercn, @captainsafia

Motivation and goals

This is part of a bigger plan to make the higher level frameworks trimmable (see dotnet/runtime#43543).

We also want to make sure people can host web servers as part of cloud infrastructure as small single file executables.

Longer term, we want to make sure that ASP.NET Core can work in full AOT mode without reflection and this is the first stage of that journey.

In scope

We want to make sure we can trim ASP.NET Core applications with confidence by default. Our target for .NET 6 is APIs only. This includes:

Out of scope

We're not going to focus on applications with Web Applications at the moment. Web Applications with Razor views won't be explicitly trimmable in .NET 6.

Risks / unknowns

Testing is one of the really hard things to cover when doing linking. To get 100% coverage you need to basically re-run all of the tests with the appropriate code linked.

Metadata

Metadata

Labels

Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releaseTheme: meeting developer expectationsUser StoryA single user-facing feature. Can be grouped under an epic.affected-allThis issue impacts all the customersarea-blazorIncludes: Blazor, Razor Componentsarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionenhancementThis issue represents an ask for new feature or an enhancement to an existing onelinker-friendlinessTracking linker friendlinessseverity-majorThis label is used by an internal tool

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions