Get Started with .NET
Welcome to the .NET ecosystem! This guide will help you set up your development environment and create your first .NET application.
What is .NET?
.NET is a free, cross-platform, open-source framework for building many different types of applications. With .NET, you can:
- Build web apps and APIs with ASP.NET Core
- Build mobile apps with .NET MAUI
- Build desktop apps with WPF, Windows Forms, and .NET MAUI
- Build games with Unity
- Build cloud-native applications
- And much more!
Step 1: Install the .NET SDK
The .NET SDK (Software Development Kit) includes the tools you need to build and run .NET applications, including the .NET runtime, the .NET CLI, and the C# compiler.
-
Visit the official .NET download page.
-
Choose the latest stable version of .NET. We recommend LTS (Long-Term Support) for production environments.
-
Download the SDK installer for your operating system (Windows, macOS, or Linux).
-
Run the installer and follow the on-screen instructions.
-
After installation, open a new terminal or command prompt and verify the installation by running:
dotnet --version
This should display the installed .NET SDK version.
Step 2: Create Your First .NET Application
Let's create a simple "Hello, World!" console application.
-
Create a new directory for your project and navigate into it using your terminal:
mkdir HelloWorldApp
cd HelloWorldApp
-
Create a new console application using the .NET CLI:
dotnet new console
This command creates a new project file (`.csproj`) and a program file (`Program.cs`) with basic "Hello, World!" code.
-
Run your application:
dotnet run
You should see the output:
Hello, World!
Next Steps
Congratulations! You've successfully set up .NET and created your first application. Here are some resources to continue your journey:
Tip: Consider using Visual Studio Code with the C# extension or Visual Studio IDE for a rich development experience.