compile in one single exe c#

C#
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
Source

Also in C#: