Dotnet Publish Optimizations Cheat Sheet

Trim unused assemblies

Last Updated: November 21, 2025

Focus Areas

Focus
Trim unused bits
Enable tiered compilation

Commands & Queries

dotnet publish -c Release -r linux-x64
Publish
dotnet-trace
Trace performance
dotnet test
Run tests

Summary

Publish optimizations keep .NET apps lean.

💡 Pro Tip: Test trimmed binaries locally as aggressive trimming can drop reflections.
← Back to Web Frameworks | Browse all categories | View all cheat sheets