100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
C#

Setting Up .NET

A practical walkthrough of installing the .NET SDK, choosing an editor, and understanding the dotnet CLI toolchain that underlies all C# development.

C# FoundationsBeginner8 min readJul 9, 2026
Analogies

Setting Up .NET

Before writing any C#, you need the .NET SDK (Software Development Kit) installed on your machine. The SDK bundles the C# compiler (Roslyn), the .NET runtime, and the dotnet command-line interface (CLI) — the single tool used to create, build, test, run, and publish .NET projects. Unlike some languages that require separate installs for compiler, package manager, and runtime, .NET ships all of this as one cohesive toolchain that works identically on Windows, macOS, and Linux.

🏏

Cricket analogy: The .NET SDK is like an all-in-one cricket academy membership that bundles coaching, a fitness program, and a booking app into one package, rather than needing separate memberships at three different facilities across countries.

Installing the SDK

You can install the .NET SDK from the official dotnet.microsoft.com downloads page, via a package manager (winget on Windows, brew on macOS, apt/dnf on Linux), or inside a container image for CI/CD pipelines. Once installed, running dotnet --version in a terminal confirms the SDK is on your PATH and reports which version is active. It's common to have multiple SDK versions installed side by side (e.g., .NET 6 LTS and .NET 8 LTS); a global.json file can pin a specific SDK version for a given project or repository.

🏏

Cricket analogy: Installing gear via the local sporting goods store, an online retailer, or a club supplier all get you the same certified bat; checking the maker's stamp confirms which model you have, and a squad's official equipment memo can pin the exact bat generation required for a specific tournament.

Choosing an Editor

Visual Studio (Windows, full IDE with rich designers and debugging), Visual Studio Code (free, cross-platform, extensible via the C# Dev Kit extension), JetBrains Rider (cross-platform, powerful refactoring), and even Vim/Neovim with an LSP-based C# extension are all viable. For most learners and cross-platform teams, VS Code with the C# Dev Kit offers the best balance of speed and features; the IntelliSense, debugging, and test-explorer integrations all work through the same underlying Roslyn and dotnet tooling regardless of editor.

🏏

Cricket analogy: Whether a batsman trains at a full-service academy, a flexible community club with add-on coaches, a specialized elite program, or with a personal coach using minimal gear, they're all ultimately drilled on the same official technique standards.

csharp
// Typical first commands after installing the SDK, run from a terminal:
//
// dotnet --version                 -> prints installed SDK version, e.g. 8.0.100
// dotnet new console -o HelloApp   -> scaffolds a new console app in ./HelloApp
// cd HelloApp
// dotnet run                       -> restores, builds, and runs the app
//
// The generated Program.cs for a console app looks like this:

Console.WriteLine("Hello, .NET!");

// dotnet also manages packages and solutions:
// dotnet add package Newtonsoft.Json
// dotnet new sln -o MySolution
// dotnet sln add HelloApp/HelloApp.csproj

The dotnet CLI plays a role similar to npm/node in JavaScript or cargo in Rust: one binary handles project scaffolding (dotnet new), dependency management (dotnet add package), building (dotnet build), testing (dotnet test), and publishing (dotnet publish) for self-contained or framework-dependent deployment.

Installing multiple SDKs without pinning a version via global.json can lead to a project silently building against a newer SDK than expected, sometimes surfacing subtly different default project settings (e.g., implicit usings or nullable reference types) between machines or CI runners.

  • The .NET SDK bundles the Roslyn C# compiler, the runtime, and the dotnet CLI into a single cross-platform install.
  • dotnet --version confirms installation; global.json pins a specific SDK version for reproducible builds.
  • dotnet new console -o <name> scaffolds a new project; dotnet run restores, builds, and executes it in one step.
  • Editors like VS Code (with C# Dev Kit), Visual Studio, and JetBrains Rider all sit on top of the same dotnet/Roslyn tooling.
  • dotnet add package and dotnet restore manage NuGet dependencies without a separate package manager tool.
  • LTS (Long-Term Support) SDK versions, such as .NET 8, are recommended for production projects needing multi-year support.

Practice what you learned

Was this page helpful?

Topics covered

#CStudyNotes#Programming#SettingUpNET#Setting#NET#Installing#SDK#StudyNotes#SkillVeris#ExamPrep