
{{ $('Map tags to IDs').item.json.title }}
How to Install .NET SDK
The .NET SDK (Software Development Kit) is essential for developing applications using the .NET framework. This tutorial will guide you through the installation of the .NET SDK on popular Linux distributions.
1. Installing .NET SDK on Ubuntu
1.1. First, you need to update your package index:
sudo apt update
1.2. Then, install the necessary packages:
sudo apt install -y apt-transport-https ca-certificates software-properties-common
1.3. Add the Microsoft signing key to your list of trusted keys:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
1.4. Add the .NET repository:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/focal/prod focal main"
1.5. Update the package index again:
sudo apt update
1.6. Finally, install the .NET SDK:
sudo apt install -y dotnet-sdk
2. Installing .NET SDK on CentOS
2.1. Start by installing the required packages:
sudo yum install -y curl
2.2. Add the Microsoft repository for .NET:
sudo curl https://packages.microsoft.com/config/rhel/7/prod.repo -o /etc/yum.repos.d/microsoft-prod.repo
2.3. Install the .NET SDK:
sudo yum install -y dotnet-sdk
3. Verifying the Installation
To check if the .NET SDK is installed correctly, run:
dotnet --version
This should return the installed version number, confirming a successful installation.
4. Creating Your First .NET Application
To confirm everything is working correctly, create a new .NET application:
dotnet new console -n HelloWorld
cd HelloWorld
This creates a new directory called HelloWorld
with a simple console application.
Run the application with:
dotnet run
You should see the output:
Hello World!
5. Conclusion
By following this tutorial, you have successfully installed the .NET SDK on your Linux system. Now you are ready to start building applications using .NET! Continue to explore .NET’s features and libraries to enhance your development capabilities.