CHAPTER 2

image

Compile and Run

Visual Studio compilation

With the Hello World program completed, the next step is to compile and run it. To do so open up the Debug menu and select Start Without Debugging, or simply press Ctrl + F5. Visual Studio will then compile and run the application which displays the string in a console window.

The reason why you do not want to choose the Start Debugging command (F5) is because the console window will then close as soon as the program has finished executing.

Console compilation

If you did not have an IDE such as Visual Studio, you could still compile the program as long as you have the .NET Framework installed. ...

Get C# Quick Syntax Reference 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.