How small is the smallest .NET Hello World binary?

Here is a dumb question that you probably never asked yourself: What is the minimal amount of bytes we need to store in a .NET executable to have the CLR print the string "Hello, World!" to the standard output?

In this post, we will explore the limits of the .NET module file format, get it as small as possible, while still having it function like a normal executable on a typical Windows machine with the .NET Framework installed.

The answer is “way, way smaller than I thought”.

13 Comments

  1. 2023-07-09 4:35 pm
    • 2023-07-10 12:18 am
      • 2023-07-10 7:38 am
        • 2023-07-10 9:11 am
      • 2023-07-10 9:10 am
    • 2023-07-10 1:30 am
      • 2023-07-10 3:14 am
        • 2023-07-10 7:41 am
          • 2023-07-10 10:52 am
        • 2023-07-10 5:04 pm
        • 2023-07-10 5:34 pm
  2. 2023-07-09 5:10 pm
    • 2023-07-10 9:18 am