C# is a strong-type, multiparadigm programming language developed by Microsoft as part of the .NET platform.
Its syntax is object-oriented and was based on C++, but it includes many influences from other programming languages, such as Object Pascal and, mainly, Java, the latter being its biggest competitor.
In this article we will see how to install on any Distribution GNU/Linux .
With wget
wget https://dot.net/v1/dotnet-install.sh
or with cURL
curl -LO https://dot.net/v1/dotnet-install.sh
sudo
or root
sudo chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest
Although it’s optional, it’s good to make the command global, this will be good for many circumstances!
sudo mv ./.dotnet/ /opt/dotnet
$PATH
and for CSharp to find the root documentRun the three commands below in order:
echo -e '\nexport DOTNET_ROOT=/opt/dotnet' | sudo tee -a /etc/profile
echo 'export PATH=$PATH:/opt/dotnet:/opt/dotnet/tools' | sudo tee -a /etc/profile
source /etc/profile
dotnet
commanddotnet --version
dotnet --help
Create a new project
dotnet new console -o HelloWorld
Enter the project, compile and run:
cd HelloWorld
dotnet build
dotnet run