1. Course
  2. Introduction to C#
  3. First program in Visual Studio Code

First program in Visual Studio Code


Last updated: 8/22/2020

Visual Studio Code is a free code editor created by Microsoft open source and compatible for Windows, Linux and Mac.

You can download it from code.visualstudio.com. Once the main code editor screen is installed it will look like the following image.

VS Code initial screen
VS Code initial screen

After completing the installation process open a console and execute the following command to create the structure of a new console project in C#.

dotnet new console -o helloworld
Create console project with .NET Core
Create console project with .NET Core

The structure of an empty console project in C# is like the following image:

First C# VS Code console project
First C# VS Code console project

After writing the source code we can compile it and execute it using Framework .NET Core from VS Code we just have to execute the following command from a new terminal.

dotnet run

The example produces the following output:

Run program in VS Code
Run program in VS Code

Introduction to C#

4 / 9

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Advertising