"Hello, World!" in C#

#hello-world #c-sharp

Written by Anders Marzi Tornblad

How to do "Hello, World!" in C#.

// hello-world.cs
class HelloWorld
    static void Main()
        System.Console.WriteLine("Hello, World!");

For writing desktop and server applications, C# has been my language of choice for over ten years now, both for work and for side projects. I really like PHP too, but I don't think it can measure up to the maturity of C#, even though PHP7 looks really nice. The size of the .NET Framework and all the open source NuGet packages available really help focusing on what to do, instead of how to do it.

For more "Hello, World!" examples, go to the Hello World category.