by 2bitencryption · 6y ago · 0 comments
You can also use the PublishReadyToRun flag to do AOT compilation so that startup times are faster (https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotne...). It still keeps the IL (intermediate language) around for certain things so the file sizes can be a bit larger, but if startup times are a concern, it's an option.
The full .net framework had ILMerge that was doing exactly that. But it isn't compatible with .net core.
It doesn't bloat the executable with binaries that are already installed on the machine, and the executable benefits from future updates to the framework.
In Unix we will have single executables with the runtime bundled inside. This mode is being referred to as "SuperHost".
Windows however will have some files left on disk:
> Ideally, we should use the SuperHost for self-contained single-file apps on Windows too. However, due to certain limitations in debugging experience and the ability to collect Watson dumps, etc., the CoreCLR libraries are left on disk beside the app.