.NET Core gives you a blazing fast and modular platform for creating server applications that run on Windows, Linux and Mac. Use Visual Studio Code with the C# extension to get a powerful editing experience with full support for C# IntelliSense (smart code completion) and debugging.
Getting Started
- Install .NET Core.
- Install the C# extension from the VS Code Marketplace.
Hello World
If you’d like to get started with a simple “Hello World” program on .NET Core, follow the steps below:
- Initialize a C# project:
- Open the command prompt (or terminal).
- Navigate to the folder where you’d like to create the C# project.
- Type
dotnet new console
. - This creates a
Program.cs
file in your folder with a simple “Hello World” program already written.
- Resolve the build assets by typing
dotnet restore
.
Tip: .NET Core Tools are now MSBuild-based. This means a
.csproj
project file will be created instead of aproject.json
.
- Running
restore
pulls down the required packages declared in theproject.json
file. - You’ll see a new
project.lock.json
file in your project folder. - This file contains information about your project’s dependencies to make subsequent restores quicker.
- When the project folder is first opened in VS Code, a notification will appear at the top of the window asking if you’d like to add the required assets to build and debug your project. Select Yes.
- Run the “Hello World” program by typing
dotnet run
in the command prompt (or terminal).
Tip: Continue exploring C# development: Debug with VS Code and .NET Core