Reading top-level statements in decompiled C#: the synthesized Program class and the Main entry point
A file of top-level statements has no visible class and no visible Main, but the assembly does. The C# compiler wraps your statements in an internal class named Program and an entry-point method with the unspeakable name <Main>$, marked with the .entrypoint directive. Here is exactly what the compiler emits for the sync and async cases, why the entry point is the method you can never write by hand, where your global usings went, and how Glass.NET reads it back as the top-level program you wrote.