Basics

C# Installation

Installing C# Environment

C# installation uses .NET SDK with Visual Studio or VS Code.

Prerequisites for C# Installation

Before you begin installing C#, ensure that your system meets the following prerequisites:

  • Operating System: Windows, macOS, or Linux
  • Disk Space: At least 1 GB of free disk space
  • Internet Connection: Required for downloading the .NET SDK and IDEs

Installing the .NET SDK

The .NET SDK is essential for developing C# applications. Follow these steps to install it:

  1. Visit the official .NET download page.
  2. Select your operating system (Windows, macOS, or Linux).
  3. Download the appropriate installer for your system.
  4. Run the installer and follow the on-screen instructions.

Once installed, verify the installation by opening a terminal or command prompt and running:

Installing Visual Studio

Visual Studio is a comprehensive IDE for C# development, especially suitable for Windows users. To install Visual Studio:

  1. Go to the Visual Studio official website.
  2. Choose the version that suits your needs (Community, Professional, or Enterprise).
  3. Download and run the installer.
  4. During installation, select the ASP.NET and web development workload to include C# support.

Upon completion, launch Visual Studio and create a new C# project to ensure everything is set up correctly.

Installing Visual Studio Code

Visual Studio Code is a lightweight and versatile editor suitable for all operating systems. To set it up for C# development:

  1. Download and install VS Code from the official website.
  2. Open VS Code and navigate to the Extensions view (Ctrl+Shift+X).
  3. Search for C# and install the extension provided by Microsoft.

After the extension is installed, you can create and open C# files to start coding.

Verifying Your C# Installation

To ensure that C# is installed correctly, create a simple Hello World application. Open a terminal or command prompt, and execute the following commands:

If you see the output Hello, World!, your C# installation is successful. You are now ready to begin developing C# applications.