You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Before writing C# code, you need to install the .NET SDK and choose an editor or IDE. This lesson walks you through the setup process and your first application.
The .NET SDK includes everything you need to build and run C# applications:
Visit https://dotnet.microsoft.com/download and download the latest LTS (Long-Term Support) release.
| Platform | Installation |
|---|---|
| Windows | Download the installer (.exe) or use winget install Microsoft.DotNet.SDK.8 |
| macOS | Download the installer (.pkg) or use brew install dotnet-sdk |
| Linux | Use your package manager (apt, dnf, etc.) or the install script |
dotnet --version
# Example output: 8.0.300
dotnet --list-sdks
# Lists all installed SDK versions
The dotnet command-line interface is your primary tool for creating, building, and running projects:
| Command | Description |
|---|---|
dotnet new console | Create a new console application |
dotnet new webapi | Create a new Web API project |
dotnet new classlib | Create a new class library |
dotnet build | Compile the project |
dotnet run | Build and run the project |
dotnet test | Run unit tests |
dotnet publish | Package for deployment |
dotnet add package <name> | Add a NuGet package |
dotnet new list | List all available project templates |
The most popular lightweight editor for C#:
Tip: The C# Dev Kit extension is free for individual and open-source use.
Microsoft's full-featured IDE:
| Edition | Cost | Best For |
|---|---|---|
| Community | Free | Students, open-source, individual developers |
| Professional | Paid | Small teams |
| Enterprise | Paid | Large organisations |
Visual Studio includes a visual debugger, profiler, database tools, and designers built specifically for .NET development.
A commercial, cross-platform IDE with excellent C# support, powerful refactoring tools, and built-in database tools.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.