.NET Tutorial - Hello World in 5 minutes
Download and install
To build your first .NET application, you'll need to install the .NET SDK, Visual Studio Code, and C# Dev Kit.
The .NET SDK (Software Development Kit) is a free and open-source collection of tools and libraries you will need to build and run applications using C#. C# is the modern object-oriented programming language you will be using for this tutorial.
Visual Studio Code (VS Code) is the world's most popular lightweight, free, and open-source code editor. This is where you will write your C# code.
C# Dev Kit is a powerful set of VS Code extensions that makes C# development easier. It helps you write, test, and debug your code as you build apps.
The .NET Winget Configuration file will install the .NET 8 SDK, VS Code, and C# Dev Kit for you. If you already have something installed, Winget will skip that installation step.
Click the link below to download the file.
Open up your downloads folder and double-click the file to begin installation.
Select Terminal or Dev Home install instructions
After double clicking the file, a terminal will open and you will see the Winget Configuration file is ready to install the .NET 8 SDK, VS Code if you do not have it, and C# Dev Kit.
Read the license agreement and agree to it by typing "y" in the terminal and pressing Enter.
Note: You are responsible for understanding the configuration settings you are choosing to execute. Microsoft is not responsible for the configuration file you have authored or imported. This configuration may change settings in Windows, install software, change software settings (including security settings), and accept user agreements to third-party packages and services on your behalf. By running this configuration file, you acknowledge that you understand and agree to these resources and settings. Any applications installed are licensed to you by their owners. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages or services.
Winget is now installing everything you need to get started! It should take about 5 minutes to complete and when it is done you will see the output below in the terminal.
After double clicking the file, Dev Home will open and you will see the Winget Configuration file is ready to install the .NET 8 SDK, VS Code if you do not have it, and C# Dev Kit.
Read the license agreement and agree to it by clicking "I agree and want to continue" in the bottom left and then clicking "Set up as admin" in the bottom right. Select "Yes" when asked if you want to allow Dev Home to make changes to your device.
Note: You are responsible for understanding the configuration settings you are choosing to execute. Microsoft is not responsible for the configuration file you have authored or imported. This configuration may change settings in Windows, install software, change software settings (including security settings), and accept user agreements to third-party packages and services on your behalf. By running this configuration file, you acknowledge that you understand and agree to these resources and settings. Any applications installed are licensed to you by their owners. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages or services.
Dev Home is now installing everything you need to get started! It should take about 5 minutes to complete and when it is done you will see the output below in the window.
Check everything installed correctly
Now that your environment is set up, go to the Search in your Windows Taskbar, and type Visual Studio Code. Click the application to open VS Code.
Note: Please note that if you open VS Code through a terminal, you will need to enable Workspace Trust.
Now open a new terminal by going to the toolbar and selecting Terminal, then New Terminal.
In your terminal, run the following command to check your installation.
dotnet
If the installation succeeded, you should see an output similar to the following:
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
If everything looks good, select the Continue button below to go to the next step.
Got an error?
If you receive a 'dotnet' is not recognized as an internal or external command error, make sure you opened a new VS Code terminal. If restarting VS Code or restarting your machine doesn't resolve the issue, use the I ran into an issue button to get help fixing the problem.