Using the Roslyn C# compiler on Windows



https://stackoverflow.com/questions/553143/compiling-executing-a-c-sharp-source-file-in-command-prompt/553155#comment137953830_553155

In 2024 the steps are - 

download .NET 4.8.1 and install it - 

at the command line use C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /t:exe /out:cs_HelloWorld.exe cs_HelloWorld.cs

here is the source code for my Hello World program

// Hello World! program
namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
            System.Console.ReadKey(true);
        }
    }
}