C# – Installation and Setup

To begin with C#, we need to set the Environment. A lot of open-source tools and software are available to run C# projects. We are preferring Microsoft Visual Studio Community version since it is open-source and flexible. It is easy to download and install. We will follow the below steps:

  • Step 1: Download & Install Microsoft Visual Studio 2022
  • Step 2: Setup C# Project in Visual Studio 2022
  • Step 3: Run First C# Program on Visual Studio 2022

Download & Install Microsoft Visual Studio 2022

To download Visual Studio, go to the official website and click Downloads as shown below:

Open Microsoft Visual Studio official website

Now, the three versions of Microsoft Visual Studio are visible: Community, Profession, and Enterprise. We will click Free download on the free and open-source Community versions:

Download Visual Studio Community version

After clicking Free download above the Visual Studio Installer VisualStudioSetup.exe will download as shown below:

Visual Studio Community version downloaded

Double-click the VisualStudioSetup.exe file and the download begins as shown below

Visual Studio installer begins the installation

It completes successfully:

Visual Studio installer completes the installation

The above will automatically open Visual Studio 2022 for the first time as shown below:

Visual Studio opens

Setup C# on Visual Studio 2022

Reach the Workloads section and go to Desktop & Mobile. From there, select .NET desktop development.

On selecting, the right section displays the installation details:

.NET Desktop Development

It also displays that Visual Studio will get installed in the following location:

Click Install:

Install .NET Desktop Development for Csharp

The final installation begins:

Visual Studio Installer

The installation completes. Restart is required as notified.

Click Restart to restart the computer:

Restart to complete Visual Studio Installation

Now, go to START and type Visual Studio 2022, and click Open:

Open Visual Studio after installation

Visual Studio 2022 is opening:

Visual Studio opening

A Sign in section is visible. It isn’t required right now, therefore, click Not now, maybe later:

Sign In to Visual Studio

Select the theme. I have selected Dark.

Click Start Visual Studio:

Visual Studio Dark Theme

Visual Studio will open. Select Continue without code:

Continue without Code on Visual Studio

The above opens the IDE:

Visual Studio opened

Create a C# project in Visual Studio

To create a C# project, Go to the File menu, then New, and click Project:

Create a new Csharp project

Now, select Console App (.NET Framework) and click Next:

Create a Console App

Now, Configure your new project, add the project name AmitConsoleApp and click Create:

Configure your new Csharp project

It opens the code editor:

Csharp code editor opens up

Add the following code:

The code gets added and it will be visible like the following:

Add the Csharp code on Visual Studio

Click on the Run button, visible on the right of Start above. On clicking, the code runs successfully as shown below:

Run your first Csharp code

This installs and setup C# on Microsoft Visual Studio 2022.

Now let us understand our first C# program.

C# Operators
C# ArrayList
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading