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:

    • Open a terminal/command prompt and navigate to the folder in which you’d like to create the app.
    • Enter the following command in the command shell:
    1. dotnet new console
  2. When the project folder is first opened in VS Code:

    • A “Required assets to build and debug are missing. Add them?” notification appears at the bottom right of the window.
    • Select Yes.
  3. Run the app by entering the following command in the command shell:

    1. 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:

    • Open a terminal/command prompt and navigate to the folder in which you’d like to create the app.
    • Enter the following command in the command shell:
    1. dotnet new console -lang F#
  2. Once it completes, open the project in Visual Studio Code:

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

    1. dotnet run

Next steps