Skip to content
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

[Trimming] MVC #41767

Open
1 of 4 tasks
JamesNK opened this issue May 20, 2022 · 1 comment
Open
1 of 4 tasks

[Trimming] MVC #41767

JamesNK opened this issue May 20, 2022 · 1 comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one linker-friendliness Tracking linker friendliness Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented May 20, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

MVC should run in a trimmed app.

Note that trimming and MVC might not be compatible. In that case, projects should be correctly annotated. e.g. MapControllers has a [RequiresUnreferencedCode] attribute on it and linker warnings are suppressed.

Describe the solution you'd like

Shipping projects under https://github.com/dotnet/aspnetcore/tree/main/src/Mvc need to add support for trimming.

See https://github.com/dotnet/aspnetcore/blob/main/docs/Trimming.md for instructions

Known issues to resolve:

  • Application parts attribute can reference assemblies that are trimmed. Ways to resolve:
    • Ignore missing assembly (not ideal. Perhaps more workable if there is a way to detect at runtime whether an app is trimmed and only do it then.)
    • Run the MSBuild task that adds part attributes after linker is run. If the linker has removed an assembly then don't include the attribute. Not sure if this is possible. May need to ask the linker/trimming team for advice here.

Tasks:

  • Resolve linker warnings
  • Integration test of calling MVC app published with trimming. Basic smoke test.

Additional context

No response

@JamesNK JamesNK added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates linker-friendliness Tracking linker friendliness labels May 20, 2022
@mkArtakMSFT mkArtakMSFT added this to the .NET 7 Planning milestone May 23, 2022
@ghost
Copy link

ghost commented May 23, 2022

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 mkArtakMSFT modified the milestones: .NET 7 Planning, 7.0-rc1 Jun 8, 2022
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jun 8, 2022
@mkArtakMSFT mkArtakMSFT added the Priority:2 Work that is important, but not critical for the release label Nov 16, 2022
@captainsafia captainsafia modified the milestones: .NET 8 Planning, Backlog Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one linker-friendliness Tracking linker friendliness Priority:2 Work that is important, but not critical for the release
Projects
None yet
Development

No branches or pull requests

8 participants