-
Notifications
You must be signed in to change notification settings - Fork 1.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
Microsoft.NET.Sdk.Web should default to TrimMode=full #30059
Comments
@dotnet/linker-contrib a new issue has been filed in the ILLink area, please triage |
There's some debate one whether we'll be ready in .NET 8, but we will keep this issue open to track changing the TrimMode default from "partial" to "full" like the Microsoft.NET.Sdk default. |
@adityamandaleeka assigning this to you as this is |
Note that this issue applies to "all" ASP.NET server app models - minimal APIs, MVC, Razor Pages, etc. |
I would go for (1) as well. That code was specifically meant to provide compatibility for Blazor WASM, which was a pre-existing trimming scenario. Having it apply to all of ASP.NET wasn't really intentional on my part.
|
@eerhardt Can this be closed now? |
Today, we are defaulting
TrimMode=partial
inMicrosoft.NET.Sdk.Web
:sdk/src/WebSdk/Publish/Targets/Microsoft.NET.Sdk.Publish.targets
Lines 89 to 90 in 67b5915
In the "api" template being added in dotnet/aspnetcore#46064, we are explicitly setting TrimMode=full.
Instead, we should do one of the following:
TrimMode=full
default from the runtime be applied to Microsoft.NET.Sdk.Web projects.partial
only if we aren't also publishing for NativeAOT. Basically addingand '$(PublishAot)' != 'true'
above.My goal would be we do (1). For places in ASP.NET that aren't fully trim-compatible, the app developer should get a warning (even from within ASP.NET code) to tell them what are things that aren't going to work.
We may consider just doing (2) in .NET 8, until things like MVC and Razor pages work correctly in fully trimmed apps.
cc @JamesNK @DamianEdwards @davidfowl
The text was updated successfully, but these errors were encountered: