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:
- .NET Core SDK. The SDK also includes the Runtime.
- The C# extension from the VS Code Marketplace.
- The F# extension (Ionide) from the VS Code Marketplace.
Create a C# “Hello World” app
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:
dotnet new console
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.
Run the app by entering the following command in the command shell:
dotnet run
Watch a video tutorial for further C# setup help on Windows, macOS, or Linux.
Create an F# “Hello World” app
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:
dotnet new console -lang F#
Once it completes, open the project in Visual Studio Code:
code .
Run the app by entering the following command in the command shell:
dotnet run
Next steps
- Continue exploring C# development: Debug with VS Code and .NET Core
- Basic Editing - Learn about the powerful VS Code editor.
- Code Navigation - Move quickly through your source code.
- Working with C# - Learn about the great C# support you’ll have when working on your .NET Core application.
- Tasks - Running tasks with Gulp, Grunt, and Jake. Showing Errors and Warnings
- .NET Core Docs - Visit the .NET Core docs for more information on this powerful cross-platform development solution.
- Deploying Applications to Azure - Deploy your app to Azure.
- Get Started with F# in Visual Studio Code