-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developers can safely trim ASP.NET apps to reduce their deployment payloads #27384
Comments
Thanks for contacting us. |
Adjusted title to give context in themesof.net |
👀 |
Making this a user story to parallel the base libraries story. |
Marking with both area-labels as this is a cross-cutting effort. |
Related issues (query based on linker-friendliness label): |
Thanks for contacting us. We're moving this issue to the |
@JamesNK what is left to be done here? I know for Blazor we still have work to do. Is there anything else related to trimming on your side, or can I file a new Blazor-specific issue and close this? |
Blazor and razor. @eerhardt youre probably closer to this than I am now. Major gaps in AspNetCore trimming/AOT story? |
I think this should be closed and more specific issues can be opened. |
But who, that knows the specific issues, is going to file it @davidfowl ? |
Doesn't matter, this issue no longer serves a purpose. Work was done in both .NET 8 and 9. If there are new specific areas of investment as part of .NET 10 then it should be filed. |
For Blazor we already have:
For SignalR, the core + JSON protocols have been made trim and AOT compatible in .NET 9. [Trimming] SignalR (dotnet/aspnetcore#41704) is still open to track the remaining 2 protocols: MessagePack and SE.Redis. For MVC, we have [Trimming] MVC (dotnet/aspnetcore#41767). The other areas listed under "Not Supported" on https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot?view=aspnetcore-9.0#aspnet-core-and-native-aot-compatibility are:
|
Thanks @JamesNK, @davidfowl and @eerhardt. Closing this now. I've created two more issues: As for the SPA point, we don't think that area needs to support trimming. |
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.
The text was updated successfully, but these errors were encountered: