dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.38k stars 9.99k forks source link

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

Open mkArtakMSFT opened 3 years ago

mkArtakMSFT commented 3 years ago

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 https://github.com/dotnet/runtime/issues/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.

ghost commented 3 years ago

Thanks for contacting us. We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

danmoseley commented 3 years ago

Adjusted title to give context in themesof.net

Pilchie commented 3 years ago

:eyes:

danmoseley commented 3 years ago

Making this a user story to parallel the base libraries story.

mkArtakMSFT commented 3 years ago

Marking with both area-labels as this is a cross-cutting effort.

danroth27 commented 3 years ago

Related issues (query based on linker-friendliness label):

Pilchie commented 3 years ago

See also https://docs.microsoft.com/en-us/dotnet/core/deploying/prepare-libraries-for-trimming, which has details on what to do here.

ghost commented 3 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost commented 2 years ago

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

mkArtakMSFT commented 2 years ago

Moving the remaining work to the .NET 8 Planning milestone to handle in the future.

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost commented 10 months ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.