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
34.85k stars 9.84k forks source link

Testing ASP.NET Core with trimming #41252

Open JamesNK opened 2 years ago

JamesNK commented 2 years ago

Is there an existing issue for this?

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

We're annotating ASP.NET Core for trimming in .NET 7. In theory, the linker and trim warnings should ensure frameworks, libraries and apps work.

We should double-check that ASP.NET Core continues to run in some trimmed, published apps.

Describe the solution you'd like

With trimming it's difficult to test trimmed features in isolation, e.g. an app uses features A and B. Did A and B only work because they were both used, etc. Building and running an app to test each feature in isolation isn't realistic.

We should do some basic smoke testing of core scenarios.

e.g. MVC Minimal API SignalR AuthN/AuthZ Kestrel/IIS/HttpSys Data protection/security/identity

Additional context

No response

javiercn commented 2 years ago

@JamesNK you can take inspiration on how we test trimming in Blazor Webassembly apps. We trim the projects on the CI only based on the Release configuration.

mkArtakMSFT commented 2 years ago

@JamesNK how do you want all of us to track this? Do you want to put out a PR to which everyone will contribute or file separate issues?

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.

hez2010 commented 1 year ago

Seems that Blazor doesn't support /p:TrimMode=full (with .NET 7 nightly sdk). If I use /p:TrimMode=full while publishing, even a hello world blazor wasm website will fail to load because of trimming.

mkArtakMSFT commented 1 year ago

Seems that Blazor doesn't support /p:TrimMode=full (with .NET 7 nightly sdk). If I use /p:TrimMode=full while publishing, even a hello world blazor wasm website will fail to load because of trimming.

@hez2010 can you please file a separate issue for this? Thanks!

ghost commented 1 year ago

Thanks for contacting us.

We're moving this issue to the .NET 8 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.

amcasey commented 5 months ago

@JamesNK I feel like we have a much more sophisticated understanding of our trimming needs now. Is this issue still relevant?

JamesNK commented 5 months ago

Tests are still important. Does trimming have enough tests? If yes, then close this.