Install .NET Core, ASP.NET Core
Here you will learn to prepare a development environment for building .NET Core/ASP.NET Core applications.
.NET Core can be installed in two ways: By installing Visual Studio 2017/2019 or by installing .NET Core Runtime or SDK.
.NET Core installer already contains ASP.NET Core libraries, so there is no separate installer for ASP.NET Core.
Install Visual Studio
Currently, .NET Core 2.1 and .NET Core 3.1 is having long term support. Visual Studio 2017 supports .NET Core 2.1, whereas Visual Studio 2019 supports both the versions.
You can use your favorite IDE, such as Visual Studio, Visual Studio Code, Sublime Text, etc. to develop, restore, build, and run .NET Core application. Here, we will use Visual Studio 2019.
If you don't have Visual Studio on your development PC, then it is recommended to install the latest Visual Studio 2019. If you already have either Visual Studio 2017 or 2019, then you already have installed .NET Core 2.1.
Download and install Visual Studio 2019 based on your OS from here. Select the appropriate edition as per your license. The community edition is free for students, open-source contributors, and individuals.
During installation, select ".NET Core cross-platform development" workload. This will install .NET Core 2.1. However, you need to install .NET Core 3.1 SDK separately.
Once installed, you can verify it by opening a command prompt (or terminal in Mac) and type dotnet --version and press Enter. This will display the installed version and usage information, as shown below.C:\Users\dev>dotnet --version
Install .NET Core 3.x
As you have seen, Visual Studio 2019 installer includes .NET Core 2.1 but not .NET Core 3.x. You need to install it separately.
To download the latest version of .NET Core, go to https://dotnet.microsoft.com/download and select the platform you are using.
As you can see above, .NET Core Runtime and .NET Core SDK are different things. .NET Core Runtime is only used to run .NET Core application, whereas .NET Core SDK includes tools and libraries to develop .NET Core applications. To set up a development environment, we need to install .NET Core SDK for the platform we use for development such as Windows, Linux, or Mac. Here we will install .NET Core SDK because we are preparing a development environment for building .NET Core applications. If you are aiming to run .NET Core application, then install .NET Core Runtime on your server or cloud or client desktop.
Click on the Download .NET Core SDK button to download the latest version of .NET Core SDK installer. It will download .NET Core 3.1 SDK as of this writing.
After downloading the installer, click on it to start the installation.
Click on Install button and follow the wizard to install .NET Core 3.1 SDK.
After installation, you can now develop .NET Core/ASP.NET Core applications. Let's learn about it next.