Basically C# is a language and we need a platform to run our code. Here platform or Framework what we are looking for is .net which helps computer to understand our C# code.
When we say .net there are actually two platforms:
- .Net framework : This will deal with only WINDOWS.
- .Net Core: This is a open source and handles cross platform for Windows, Linux, and macOS.
Simply, .Net is a Runtime which provides space to run our code and instruct the computer what to do.
.Net consists of 2 Components
- CLR (Common Language Runtime): As it is in name it provides runtime for the program
- FCL(Framework Class Library) : It consists of Libraries which are developed by microsoft developers or other developers which helps coding easy.
.Net not only provide runtime for C#, it also provides runtime for other languages like F#, VB .net .
Now we will Download the .Net SDK (which consists of both CLR and FCL) to run C# program.
Installation of .NET :
Go to the above mentioned link and click on DOWNLOAD .NET CORE SDK under .NET Core section as shown below
After installation process, to check whether .NET Cli is installed in your system, open your command prompt by typing cmd in Run(window +R) if your using windows.You can use terminal or shell depending on type of OS your using . Here .Net Cli means command Line Interface which is a tool used to interact with SDK.
If SDK is installed then you will be able to access from any location . To test , run donet command in cmd as shown below
if you can see something like this after running the command then it is installed.
IF you want to create a new console application in .Net then use the below command
Here I first created new directory / folder using mkdir command.
After navigating to code folder by using 'cd code' command, I ran "dotnet new console" command.
dotnet new console
After runing of command the following displays as shown in picture meaning new console application got created.
Installation of Visual Studio code :
Now we will see how to install visual studio code ( which is a code editor)
Go to below link and click on Download option
After clicking on Download , it will start downloading .EXE file and then click on 'next' and 'Finish' . After this ,you will see visual studio code in start menu .