C# is a modern programming language and an object-oriented programming language, pronounced as 'C sharp.' It was developed by Microsoft's Anders Hejlsberg and is approved by the European Computer Manufacturers Association (ECMA) and ISO.
The C# language is one of the Common Language Infrastructure languages, with syntax similar to Java. It's user-friendly for those familiar with C, C++, or Java.
Explore the following article to discover how to set up the environment for C#.
Article Contents
1. Preparation
1.1. .Net Framework
1.2. Visual Studio IDE
2. Setting up the Environment for C#
I. Preparation
C# is utilized to execute server-side functionality for various applications such as web, windowed, or console forms. Setting up the environment for C# requires the presence of .NET Framework and an Integrated Development Environment (IDE).
In detail:
1: .NET Framework
.NET Framework serves as the platform to build, deploy, and run web services and applications. To run C# applications or any program, installing the NET Framework component on the system is a prerequisite.
Additionally, .NET also supports various programming languages like Visual Basic, Visual C++, and more. C# stands out as one of the most popular languages integrated into the .NET Framework. It comprises two fundamental components:
- Common Language Runtime (CLR): The .NET Framework contains a runtime environment called CLR that executes code. It provides services to facilitate the development process.
- Framework Class Library (FCL): This library consists of classes, value types, and interfaces that offer access to system functionalities.
On the Windows operating system, .NET Framework is installed by default. To explore information about the .NET Framework version, you can click on .NET Framework Versions.
2. Visual Studio IDE
Microsoft provides an Integrated Development Environment (IDE) tool called Visual Studio for developing applications using various programming languages like C#, VB (Visual Basic), and more.
To install and use Visual Studio for commercial purposes, users will need to purchase a license from Microsoft. For educational purposes (non-commercial use), Microsoft offers the free Visual Studio Community Version.
II. Setting up the Environment for C#
Follow the steps below to set up the C# environment for the Windows platform:
Step 1: Download Visual Studio Community Version to your machine and install it.
Download Visual Studio Community Version to your machine and install it here: Download Visual Studio Community
Step 2: Run the .exe file and follow the on-screen instructions to install Visual Studio Community Version on your system.
Step 3: Choose .Net Desktop Development and click Install at the bottom right corner as shown below:
Step 4: After installation, open Visual Studio Community Version. The screen will display a prompt asking you to log in for the first time. You can skip this login step if desired.
Step 5: A dialog box will appear on the screen, prompting you to select Development Settings and the color theme. After selecting the required options, click Start Visual Studio as shown below:
Step 6: To create a console application in C#, navigate to File => New => Project as shown below:
Step 7: Choose Console App, name your project, select a location to save project files, and then click OK as shown below:
Step 8: Now, the screen will display the template, and you can start writing C# code.
In this article, Mytour has just guided you on setting up the environment for C#. If there are any questions or queries, readers can leave their comments below the article. In the next article, Mytour will further introduce you to the program structure in C#.
