I had previously thought that programming (.NET) (pronounced "Dot net") would not be possible on Linux. After I learn and learn about (.NET) and the evidently can, not like what I thought before.
Image Source .NET platform
The world has changed.
Since then Microsoft CEO (Satya Nadella) has stated "Microsoft Love Linux" is that true?
There are several Microsoft products that have become open source, including (.NET) which have been open-sourced since 2014.
As IMMO said
"Today (12 November 2014) is an extraordinary day for .NET! We are pleased to announce that .NET Core will be open source, including runtime and framework libraries.
This is a natural development from our open source efforts, which includes managed compilers (C #, VB, and F #) and ASP.NET:"
Source
Microsoft programmers also contribute to many open source projects.
The proof, Microsoft became the organization that contributed the most to open source projects (on Github), defeating Facebook and Google.
Now let's get into the .NET (point)
C# (pronounced "C Sharp") is a programming language made by Microsoft that is designed to run on .NET.
.NET itself is a platform for creating and running C#, F#, and VB programs. NET.
.NET there are several types:
The .NET Framework is a platform for creating Windows applications only;
.NET Core is a platform that can be used on various platforms such as Linux and MacOS;
XAMARIN is a .NET platform specifically for mobile.
Which .NET are we going to use?
Of course we will use the .NET Core.
There are several tools that we must prepare to do C # programming on Linux:
Text Editor (Visual Studio Code) for writing program code;
Compiler (.NET SDK) for compiling program code.
That is all?
That's right, that's all.
Actually there are other alternatives, namely using Monodevelop. However, as of this writing, I will only use equipment from Microsoft.
Why do you have to use VS Code, can you not use another text editor?
It could be ...
However, I recommend VS Code because there are extensions that we can use to debug C# programs.
Please install VS Code page for a complete list of available installation options.
Or
Visual Studio Code is officially distributed as a Snap package in the Snap Store.
You can install it by running?
sudo snap install --classic code # or code-insiders
Note: If snap isn't available in your Linux distribution, please check the following Installing snapd guide, which can help you get that set up.
After that, install the C# extension.
This extension is a kind of plug-in that we will use to debug the program.
Different distro also how to install it. I will install .NET on a Linux Mint 18.2 64-bit distro.
First we must add the .NET repository:
Note: this is for Ubuntu version 18.04, for other versions and distributions please check at https://docs.microsoft.com/id-id/dotnet/core/install/linux-package-manager-ubuntu-1804
Then, we can install .NET with the command:
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1 -y
Stove until the process is complete.
After that, to ensure that .NET is installed correctly, try typing the command"dotnet --version".
Please open a terminal, then type the following command to create a C# .NET project
dotnet new console -o HelloApp
Description:
Apart from console applications there are also other types of applications such as ASP for Web applications.
We can see with dotnet new --help.
Type the following command:
code HelloApp
Then it opens like this: