MSDN Documentation

Your guide to Microsoft technologies.

Getting Started with C#

Welcome to the C# documentation! This section provides the essential information you need to begin your journey with C# programming, one of the most popular and versatile languages for building a wide range of applications.

What is C#?

C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language developed by Microsoft. It is part of the .NET framework and is widely used for building Windows applications, web services, mobile apps (with Xamarin/MAUI), cloud solutions on Azure, and even games with Unity.

Key Features of C#

Setting Up Your Development Environment

To start coding in C#, you'll need a development environment. The most common and recommended tool is Visual Studio. You can download Visual Studio Community Edition for free, which is suitable for individual developers, open-source projects, and academic research.

Recommendation:

Download and install Visual Studio Community Edition from the official Visual Studio website. Ensure you select the ".NET desktop development" or "ASP.NET and web development" workload during installation.

Your First C# Program: "Hello, World!"

Let's write a simple "Hello, World!" program to get your feet wet.

using System;

namespace HelloWorldApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
        }
    }
}

Explanation:

Tip:

When you run this code in Visual Studio, you'll see "Hello, World!" printed in the console window. This is your first successful C# execution!

Next Steps

Now that you've set up your environment and written your first program, you're ready to explore more advanced C# concepts. We recommend moving on to:

Happy coding!