In this recipe, we will learn how to set up .NET Core. This recipe is pivotal if you are installing it for the first time.
Installing .NET Core is a relatively easy task. Microsoft did a great job to make it easy to install .NET Core to any computer. All we need is a clean computer and an internet connection.
The first step is to open a web browser and navigate to the http://dot.net/core site. It'll detect a host operating system, and will show downloading and installation steps.
- Installation for Windows:
On the Windows platform, we can easily download .NET Core SDK installer by clicking the
Download .NET Core SDK
button and beginning setup. Once setup finishes, you're ready to develop/run .NET Core applications on the machine.
- Installation for Linux: On the Linux platform, there are different commands to install .NET Core on Ubuntu, RedHat, Debian, Fedora, CentOS, and Suse distribution. We should select the correct distribution on the page, and execute some Terminal commands by following preceding instructions.
- Installation for macOS: On the macOS platform, it's as easy as downloading the .NET Core SDK package.
- Installation for Docker: There is another platform available to deploy and run .NET Core applications: Docker. Docker is simply a virtualization platform. You may run Docker on the machine and deploy your .NET Core applications into Docker. Once you successfully deploy an application to Docker, it's easy to run more than one instance of it.
Docker usually helps developers to scale their applications with minimum management cost.
After installing .NET Core 2.0 SDK, you can open the Terminal/Command Prompt window and run the following command:
dotnet --info
This command displays the installed and most recent .NET Core SDK version (2.0.2 at the time this book was written), Runtime Environment
info (OS platform, architecture, version, and more), and .NET Core SDK installation path:
We can see Base Path
includes the .NET Core SDK version. If we remove that version from the path and open that path in Finder/Explorer, we can see all the installed .NET Core SDK versions:
It's as easy as deleting a folder to remove any .NET Core SDK version on a machine.