Building self-contained, single executable .NET Core 3 CLI tools

.NET Core 3 brings single executable packaging. In this article, we'll explore how to build command line interfaces and distribute them as self-contained executables, and the tradeoffs between binary size and startup time.

Radu Matei

13 minute read

This is the .NET Core’s first iteration at self-contained binaries. It is not ideal - the resulting size of ~40M is probably way too large for simple applications. But the fact that now we can actually create a global tool with .NET and distribute it without requiring users to install .NET is extremely exciting! Not to mention the ease of packaging applications in containers, and not having to copy tens of files.