c# compile to single exe code example Example: compile in one single exe c# dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true