.NET Framework Documentation

Getting Started with .NET Framework

Welcome to the .NET Framework! This guide will help you set up your environment and create your first .NET application.

Note: While .NET Framework is still supported for existing applications, Microsoft recommends using .NET (formerly .NET Core) for new development due to its modern features and cross-platform capabilities.

Prerequisites

Before you begin, ensure you have the following:

Step 1: Install the .NET Framework

The latest version of .NET Framework can be downloaded from the official Microsoft website. It's usually pre-installed on modern Windows versions, but you can check for updates or specific versions.

You can find download links and specific version installers here: Download .NET Framework

Step 2: Choose a Development Environment

You'll need an Integrated Development Environment (IDE) to write, build, and debug your code. The most popular choice for .NET development is:

Download Visual Studio here: Download Visual Studio

During installation, ensure you select the ".NET desktop development" workload to get the necessary tools for .NET Framework development.

Step 3: Create Your First Application

Let's create a simple "Hello, World!" console application.

Using Visual Studio:

  1. Open Visual Studio.
  2. Click "Create a new project".
  3. Search for "Console App (.NET Framework)" and select it.
  4. Click "Next".
  5. Name your project (e.g., "HelloWorldApp") and choose a location.
  6. Click "Create".

Visual Studio will generate a basic project structure. The main code file is usually named Program.cs. Replace its content with the following:

using System;

            namespace HelloWorldApp
            {
                class Program
                {
                    static void Main(string[] args)
                    {
                        Console.WriteLine("Hello, .NET Framework World!");
                        Console.WriteLine("Press any key to exit.");
                        Console.ReadKey();
                    }
                }
            }
            

Step 4: Run Your Application

To run your application:

  1. In Visual Studio, press F5 or click the "Start" button (a green triangle).

A console window will appear displaying your message. Press any key to close it.

Next Steps

Congratulations! You've successfully set up your environment and created your first .NET Framework application.

To continue learning, explore these topics: