4 ms·
I'm confused about something -- does this "single-file" contain the full .NET runtime, a-la a Go executable? Or is this single-file just the full set of manage
by 2bitencryption 6y ago
I'm confused about something -- does this "single-file" contain the full .NET runtime, a-la a Go executable? Or is this single-file just the full set of managed code, packed together, and still requires a runtime to execute?
- deleted 6y ago[deleted]
- computerex 6y agoThey describe 3 ways of "packing" here: https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md https://github.com/dotnet/designs/blob/master/accepted/2020/... 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.
- mdasen 6y agoYes, it can contain the .NET runtime like a Go executable. You can already (mostly) do this today with .NET Core 3/3.1 (I say "mostly" just because it simply unzips the runtime on first run). I deploy to Linux with everything in a single file and it's been perfect - headache-less deploys. You can read more at https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design_3_0.md https://github.com/dotnet/designs/blob/master/accepted/2020/... and https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pu.... I haven't had any problems with it at all. The size is a bit bigger, but I don't really care about that and then I can just run it like anything else without worrying about making sure that the .NET runtime is on my deploy system and kept up to date. 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/dotnet-core-3-0#readytorun-images 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.
- cm2187 6y agoI wish there was an intermediary solution, where it wouldn't ship the runtime but would still be single file. The full .net framework had ILMerge that was doing exactly that. But it isn't compatible with .net core.
- shawnz 6y agoIt seems like you can set PublishSingleFile true with self-contained false, isn't that what you want?
- cm2187 6y agoIf we can do that (and don't pay a sluggish start up time as some mentioned we currently do) then yes, absolutely. 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.