JavaScript:
//output folder = 68mb
dotnet publish -r win-x64 -c Release --self-contained
Introduces a flag called PublishSingleFile which produces a single .exe file
JavaScript:
//output folder = 68mb
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
A new flag called PublishTrimmed which doesn’t include DLL’s that aren’t used to reduced the size. You need to use both the flags together to create a Trimmed Self-Contained Single Executable in .NET Core 3.0.
JavaScript:
//output folder = 29mb
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
src - https://www.talkingdotnet.com/create-trimmed-self-contained-executable-in-net-core-3-0/