Writing and compiling code using the Developer Command Prompt

When you install Visual Studio, other tools are installed too. One of those tools is the Developer Command Prompt for VS2015 that has its path set to find developer tools such as the C# compiler.

Writing code using Notepad

Start Notepad (or your favorite text editor) and enter the following code:

class Program { static void Main() { System.Console.
WriteLine("Hello C#!"); } }

You can type the code all on one line or spread it out over multiple lines and indent your lines to make it easier to read.

Note

C# is case sensitive, meaning that you must type uppercase and lowercase characters exactly as shown in the preceding code. C# is not whitespace sensitive, meaning that it does not care if ...

Get C# 6 and .NET Core 1.0: Modern Cross-Platform Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.