Using .NET Core in Visual Studio Code

.NET Core provides a fast and modular platform for creating server apps that run on Windows, Linux, and macOS. Use Visual Studio Code with the C# and F# extensions to get a powerful editing experience with C# IntelliSense, F# IntelliSense (smart code completion), and debugging.

Prerequisites

Install the following:

Create a C# "Hello World" app

  1. Initialize a C# project:

  2. Open a terminal/command prompt and navigate to the folder in which you'd like to create the app.

  3. Enter the following command in the command shell:

cmd dotnet new console

  1. When the project folder is first opened in VS Code:

  2. A "Required assets to build and debug are missing. Add them?" notification appears at the bottom right of the window.

  3. Select Yes.

  4. Run the app by entering the following command in the command shell:

cmd dotnet run

Watch a video tutorial for further C# setup help on Windows, macOS, or Linux.

Create an F# "Hello World" app

  1. Initialize an F# project:

  2. Open a terminal/command prompt and navigate to the folder in which you'd like to create the app.

  3. Enter the following command in the command shell:

cmd dotnet new console -lang F#

  1. Once it completes, open the project in Visual Studio Code:

cmd code .

  1. Run the app by entering the following command in the command shell:

cmd dotnet run

Next steps