You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the TrimMode=Link publish option, none of the ASP.NET Core assemblies are affected. They all remain at their full size even if members within those assemblies are never accessed by a code path in the application.
Because of the quantity and size of the ASP.NET Core assemblies, there is a big opportunity to reduce the size of a deployed app if these assemblies participated in member-level trimming.
When using the
TrimMode=Link
publish option, none of the ASP.NET Core assemblies are affected. They all remain at their full size even if members within those assemblies are never accessed by a code path in the application.Because of the quantity and size of the ASP.NET Core assemblies, there is a big opportunity to reduce the size of a deployed app if these assemblies participated in member-level trimming.
As an example, this sample ASP.NET Core application has the following trimmed container image sizes on Alpine Linux:
If the ASP.NET Core assemblies participated in assembly-level trimming, this reduction would be even greater.
Repro steps:
git clone https://github.com/dotnet/dotnet-docker.git
cd dotnet-docker/samples/aspnetapp
docker build -t default-trimming -f Dockerfile.alpine-x64-slim .
Dockerfile.alpine-x64-slim
to include/p:TrimMode=Link
in thedotnet publish
calldocker build -t link-trimming -f Dockerfile.alpine-x64-slim .
docker inspect --format "{{ .Size }}" default-trimming
docker inspect --format "{{ .Size }}" link-trimming
The text was updated successfully, but these errors were encountered: