News for hackers. Stuff that matters.
Re:C# 9 top-level programs and target-typed expressions by pjc50 on Tuesday March 30, 2021 @06:36PM (#26641419)
You have to set up "dotnet publish" for the project that makes the executable.

It then makes a stub loader "your program.exe" which looks and behaves normally. You can then make it "self contained", which bundles the assemblies for you and transparently unpacks them.

You can have different publish profiles for the different targets.

Re:C# 9 top-level programs and target-typed expressions by benaadams on Tuesday March 30, 2021 @09:49PM (#26642677)
.NET 5.0 can now create true single file that doesn't need any unpacking on first run (except on Windows where the Jit and GC dlls will live or be unpacked separately; but that should be resolved in .NET 6.0)