MSDN Documentation

Your guide to Microsoft technologies

Installing C# and the .NET SDK

This guide will walk you through the steps to install the necessary tools for C# development on your system.

Prerequisites

Before you begin, ensure you have the following:

Download the .NET SDK

The .NET SDK includes the C# compiler, the .NET runtime, and various development tools. You can download the latest version from the official Microsoft website.

Download .NET SDK

Note: For most C# development, the latest LTS (Long Term Support) or Current version of the .NET SDK is recommended.

Installation Steps

1

Download the Installer: Navigate to the .NET download page and select the installer appropriate for your operating system. For Windows, this is typically an executable (.exe) file. For macOS and Linux, you'll find package managers or script options.

2

Run the Installer:

  • Windows: Double-click the downloaded .exe file. Follow the on-screen prompts, accepting the license terms and choosing installation options.
  • macOS: Open the downloaded .pkg file and follow the installer prompts. You might need to authenticate with your administrator password.
  • Linux: Refer to the official documentation for installation via package managers (e.g., apt, dnf, yum) or by using the provided script.
3

Verify Installation: After the installation is complete, open a new terminal or command prompt window and run the following command to check the installed .NET SDK version:

dotnet --version

You should see the version number printed in the console.

4

Optional: Install a Code Editor/IDE: While you can use any text editor, an Integrated Development Environment (IDE) or a powerful code editor will greatly enhance your productivity.

  • Visual Studio: The full-featured IDE for Windows and macOS, offering extensive C# development capabilities. Download Visual Studio
  • Visual Studio Code: A lightweight, free, and extensible code editor with excellent C# support via extensions. Download VS Code

Troubleshooting Common Issues

Next Steps

Once the .NET SDK is installed, you're ready to start writing your first C# application! We recommend proceeding to the C# Fundamentals section.