Install and Set Up .NET SDK on Windows, macOS, and Linux
Last Updated :
06 Mar, 2025
C# is a powerful programming language used in various applications from desktop to mobile development. It is widely used for building full-stack web applications, AI (Artificial Intelligence), Augmented Reality (AR), and Virtual Reality (VR). In this article, we will set up an environment for C# by installing the .NET SDK.
The official recommendation is to use Visual Studio (IDE) for C# development, as it provides comprehensive features. If we install Visual Studio, the .NET SDK is included and does not need to be downloaded separately.
Download and Install and .NET SDK – Windows Operating System
Step 1: Go to the official website and choose the latest .NET SDK version. Here, we are downloading .NET SDK version 9.
Step 2: Go to Downloads and install the dotnet-sdk.exe file as shown in the below image.
Step 3: Click on the Install button and wait until the installation process is completed.
Step 4: After installation, open command prompt and type the below command to verify the .NET SDK version that is installed in the system.
dotnet –version
If installed correctly, it will display the installed .NET SDK version.
Note: The path is automatically set when we install .NET SDK
Step 5: Now open a command prompt and create an empty .NET project using the following command:
dotnet new console -o <Project-Name>
In the <Project-Name> we can provide the name of the project which we want to build in this example as shown below. Here, we use the project name as HelloWorld. This command will create an empty project template with all the necessary packages required to run the .NET project.
This is the complete folder structure which is created using the above command.
The Program.cs is the entry point in this file the C# code is written we can not directly open this file but we can open it in any IDE like Visual Studio or Visual Studio Code this is the default code which is written inside the program.cs file as shown in the below image
This is a simple program we can run it using the following command mentioned in the below steps.
Step 6: Now we need to build the project using the command mentioned below.
Navigate to the project directory:
cd HelloWorld
Build the project using:
dotnet build
Step 7: Now to see the output run the command mentioned below.
dotnet run
This will execute the default Program.cs file and display output in the console.
Note: Navigate to the newly created project directory using cd <Project-Name> before running dotnet build or dotnet run.
Download and Install .NET SDK – macOS
Step 1: Go to the official website. The website will automatically detect the operating system and then click on Download for macOS.
Step 2: Then go to Downloads and find the dotnet.pkg file and double-click to install it. Then follow the installation instructions.
Step 3: Verify that it is installed correcting by checking the version using the below command on the terminal:
dotnet –version
If it is correctly installed then it shows the version which we download.
Alternative Installation via Homebrew
You can also install .NET SDK using Homebrew:
brew install dotnet-sdk
If necessary, add the .NET CLI tools to your system PATH:
echo ‘export PATH=”/usr/local/share/dotnet:$PATH”‘ >> ~/.zshrc
source ~/.zshrc
Download and Install .NET SDK – Linux (Ubuntu)
Step 1: Go to the official website and choose the distribution which we are using. Also, check the compatible version.
Here, we are downloading and installing .NET SDK for ubuntu.
Before installing, update package lists and add Microsoft’s repository:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
Step 2: Now install the .NET SDK using the below command:
sudo apt-get install -y dotnet-sdk-9.0
Step 3: If you plan to run web applications, install the ASP.NET Core Runtime. This step is optional.
sudo apt-get install -y aspnetcore-runtime-9.0
Step 4: Now verify the installation by using the commanding the terminal which checks the version of the current .NET SDK on the system.
dotnet –version
If the installation is completed successfully then it shows the current version of dotnet.
Similar Reads
How to Install and Use NVM on Windows
NVM or Node Version Manager is a command-line tool that allows developers to manage multiple versions of Node.js on a single machine. This function offers the flexibility to work on different projects and versions of Node.js. In this guide, we'll walk you through the steps to install and use NVM on
3 min read
How to Download and Install Postman on Windows?
Postman is a platform for building and using APIs and helps for simplifying the steps in the APIs lifecycles to streamline collaboration for creating faster APIs. It includes various API tools to accelerate the development cycle, including the design mockups and testing documentation, etc. Postman w
2 min read
How to Download and Install Nitro Reader on Windows?
A PDF editor, a browser-based program for electronic signatures, and PDF productivity tools are available as products. Tools for cloud-based user management, deployment, and analytics are included in subscription services. Additional free document conversion websites are run by Nitro. While customer
1 min read
How To Install Microsoft Edge On Linux?
Want to set up Microsoft Edge on a Linux system? Linux users may now access Microsoft Edge, which was previously only available on Windows. Microsoft Edge for Linux is simple to download and use as your daily browser, regardless of the distribution you're usingâUbuntu, Debian, or another. Regardless
4 min read
How to Download and Install Skype on Windows?
The Skype application is the most popular telecommunications and video conferencing application operated by Skype Technologies under Microsoft Corporation. Skype currently has more than 100 million users all over the world as of March 2020. The Skype application operates the users for the  VoIP-base
2 min read
How to Install .NET on Linux?
.NET is a free, cross-platform, open-source developer platform for building many different types of applications. With .NET you can build various kinds of applications including : Web ApplicationMobile AppsDesktop AppsGamesIOTYou can write .NET apps in one of the following languages :Â C#F#Visual ba
1 min read
How to Install Node.js on Windows
Installing Node.js on Windows is a straightforward process, but it's essential to follow the right steps to ensure smooth setup and proper functioning of Node Package Manager (NPM), which is crucial for managing dependencies and packages. This guide will walk you through the official site, NVM, Wind
6 min read
How to Install Nmap on Windows?
Nmap is computer software that is used to scan networks. It was developed by Gordon Lyon. It is written in C, C++, Python, and Lua. Its initial release was in 1997, and its stable release was in 2021. Its latest version is 7.92. It is free software used for security purposes of networks. It can be r
3 min read
How to Install NuPIC on Windows?
Installing and running NuPIC (Numenta Platform for Intelligent Computing) on Windows can be a bit of a challenge, but with the right steps, it can be done relatively easily. In this article, we will go over the process of installing and running NuPIC on a Windows machine. Steps to Install and Run Nu
2 min read
How to Install Anaconda on Windows
Anaconda is a popular open-source distribution of Python and R and is widely used in the field of data science, machine learning and scientific computing. It contains Jupyter, Sypder, etc. that are well capable of handling a large number of data sets and processes as per user's need. It helps in sim
4 min read