Getting Started With .NET Core And Visual Studio Code

.NET Core

ASP.NET Core is an open-source and platform-independent software framework for developing web, mobile, and desktop-based applications using Windows, Mac, and Linux operating systems (a developer can develop the desktop application from .NET Core 3.0). .NET Core supports a command line interface for developing the applications.

ASP.NET Core fully supports C#, F#, and partially supports VB.NET. Currently, VB.NET compiles and runs on .NET Core, but the separate Visual Basic Runtime is not implemented. Microsoft announced that the latest version, .NET Core 3 will include the Visual Basic Runtime.

Why .NET Core?

Due to the following reasons, developers should use the .NET Core framework for development.

  • Cross-Platform Development.
  • Targeting Microservices.
  • Lightweight.
  • Docker Containers support.
  • High-performance and scalable systems.
  • Side-by-side .NET versions per application.

Versions History

version Number Release Date
1.0 06-27-2016
1.1 11-18-2016
2.0 08-14-2017
2.1 05-30-2018
2.2 12-04-2018
3.0 In Development


IDEs for Development

There are a lot of IDEs available for development but most of the developers use Visual Studio and Visual Studio Code for development.

Software Installation

Prerequisites

  • Windows 8.1 or higher OS, or Linux
  • Visual Studio 2017 or Visual Studio Code

Let's install .NET Core 2.1.502 on Windows OS

Please download and use the SDK from here.

Once the SDK is downloaded, follow the below steps.

Step 1. Double-click the downloaded file.

Step 2. Click on the "Install" button.

Let'sĀ install .NET Core 2.1.502

Step 3. In the Permission pop-up, click "Yes".

Step 4. Then, you will see a process window like below.

Process window

Step 5. The highlighted things are installed on your machine.

 Installed on your machine

That’s it. You have successfully installed .NET Core on your machine. To ensure that the SDK is successfully installed or not, open your command prompt and type the below command.

dotnet –version

If it is successfully installed on your machine, you will get the following output for version 2.1.502.

 Output for version 2.1.502

Creating a Simple Console Application

Step 1. Open Visual Studio Code or command prompt on your machine.

Step 2. After opening the Command Prompt, change your working path using the cd command.

Step 3. Next, we are creating a simple console application using the below command.

/dotnet new console -o "MyFirstConsoleApplication"

Note. Here, MyFirstConsoleApplication is the project name.

After creating the console application, you will get the following output.

Console application

Step 4. Next, if we need to open the console application's source code on Visual Studio Code Editor, we can use the below command.

/code ./MyFirstConsoleApplication

MyFirstConsoleApplication

After hitting Enter, it automatically opens the project's source code in Visual Studio Code.

Output Screen

Output Screen

Step 5. Next, we run the application in the terminal using the following command.

dotnet run

Dotnet run

Finally, we have successfully installed .NET Core and created a simple console application in .NET Core.


Similar Articles