Before configuring Visual Studio Code, the .NET Core SDK must be present on your system. If you haven’t installed it yet, follow the steps described here.
If you have successfully installed .NET Core SDK and Visual Studio Code, open Visual Studio Code, and choose the theme you want (Figure 1). Then, click on the “Mark Done” button.
Click on the “Extensions” button in the Activity Bar on the left. In the Side Bar that opens, search for “C# Dev Kit” developed by Microsoft (as shown in Figure 2), click on the “Install” button and wait for the installation to complete.
Next, you must add a folder to the workspace. Click on the “Explorer” button in the Activity Bar on the left. In the Side Bar that opens, click on the “Open Folder” button, as shown in Figure 3.
Open (select) an empty folder where your projects should be stored. If a popup window opens asking you if you trust the authors of this folder, you should click on the “Yes, I trust the authors” button.
Notice: It is a good idea to create a folder named “VS Code CS Projects” in your Documents folder and add that folder to the workspace.
Next, hit the CTRL + SHIFT + P key combination to open the Command Palette, and run the “.NET: New Project…” command, as shown in Figure 4.
This step will force Visual Studio Code to install some extra packages and activate C#, C# Dev Kit and C# IntelliCode as shown in Figure 5.
Now, you need to set which console the target program should be launched into. From the main menu, click on File → Preferences → Settings. Search for the keyword “CSharp”. Select “Debugger” on the left, as shown in Figure 6, and set the field “Debug: Console” to “integratedTerminal”.
One thing that I do in my books in order to save paper is to decrease the number of spaces per indent to two. From the main menu, click on File → Preferences → Settings. Search for the keyword “Tab”. Select “Text Editor” on the left, as shown in Figure 7, and set the field “Editor: Tab Size” to 2.
Visual Studio Code has been configured properly! Now it’s time to conquer the world of C#!