To start installing .NET, you'll need to register the Microsoft signature key and add the Microsoft Product feed. This only needs to be done once per machine.
Open a command prompt and run the following commands:
Open a new command prompt and run the following commands.
dotnet new console -o myAppcd myApp
The dotnet command will create a new application of type console for you. The -o parameter will create a directory named myApp where your app will be stored, and populates it with the required files. The cd myApp command puts you into the newly created app directory.
The main file in the myApp folder is Program.cs. By default, it already contains the necessary code to write "Hello World!" to the Console.
using System;namespace myApp{class Program{staticvoidMain(string[] args){Console.WriteLine("Hello World!");}}}
Run your app
In your command prompt, run the following command:
dotnet run
Congratulations, you've built and run your first .NET app!
Get an editor
Visual Studio Code is a free, cross-platform code editor with support for .NET.