Publishing A Single EXE File In.NET Core
// self contain publish
dotnet publish -r win-x64 -c Release --self-contained
// publish in signle file
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
// publish self contain single file and triming for small size
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true