Start Visual Studio 2017.
Navigate to File | New | Project... or press Ctrl + Shift + N.
From the Installed list on the left, expand Visual C#, and choose .NET Core. In the list at the center, choose Console App (.NET Core). Enter the name WelcomeDotNetCore, set the location to C:\Code, enter Chapter01 as the solution name, and click on OK or press Enter, as shown in the following screenshot:
Ignore the target set to .NET Framework 4.7.1. That drop-down list box does not affect .NET Core projects!
In the code editor, delete the statement on line 9 that says the following:
Console.WriteLine("Hello World!");
Inside the Main method, type the letters sy, as shown in the following screenshot, and note the IntelliSense menu that appears:
IntelliSense shows a filtered list of keywords, namespaces, and types that contain the letters sy and highlights the one that starts with sy, which happens to be the namespace that we want—System.
Type a dot (also known as decimal point or full stop).
IntelliSense automatically completes the word System for you, enters the dot, and displays a list of types, such as AggregateException and Action, in the System namespace, as shown in the following screenshot:
Type the letters con, IntelliSense shows a list of matching types and namespaces, as shown in the following screenshot:
We want Console. Press the down arrow on your keyboard to highlight it. When Console is selected, type a dot.
IntelliSense shows a list of the members of the Console class, as shown in the following screenshot:
Members include properties (attributes of an object, such as BackgroundColor), methods (actions the object can perform, such as Beep), events, and other related things.
Type the letters wl. IntelliSense shows two matching members containing these letters in title case, WindowLeft and WriteLine, as shown in the following screenshot:
Use the down arrow to highlight WriteLine and then type an open parenthesis (.
IntelliSense autocompletes WriteLine and enters a pair of parentheses.
You will also see a tooltip telling you that the WriteLine method has 18 variations, as shown in the following screenshot:
Type a double quote ("). IntelliSense enters a pair of double quotes for you and leaves the keyboard cursor in between them.
Type the text Welcome, .NET Core!, as shown in the following screenshot:
The red squiggle at the end of the line indicates an error because every C# statement must end in a semicolon. Move the cursor to the end of the line and type a semicolon to fix the error.