Installing the .NET SDK
🎯 What You'll Learn
- How to download and install the .NET 8 SDK
- Installation steps for Windows, macOS, and Linux
- Verifying your installation
- Understanding what gets installed
- Setting up Visual Studio 2022 (optional but recommended)
- Alternative editors: VS Code and JetBrains Rider
- Troubleshooting common installation issues
What You're Installing
When you install the .NET SDK, you get everything needed to build, run, and publish .NET applications:
- .NET Runtime: Executes your applications
- C# Compiler (Roslyn): Compiles your C# code
- dotnet CLI: Command-line tools for creating and managing projects
- MSBuild: Build system for compiling projects
- NuGet: Package manager for libraries
- Templates: Project templates (console, web, API, etc.)
- Libraries (BCL): Base Class Library with thousands of APIs
SDK: Install this for development. Includes everything.
Runtime: Install this only for running apps (production servers).
For this guide: You need the SDK!
Step 1: Download the .NET 8 SDK
Head to the official .NET download page: https://dotnet.microsoft.com/download
Download .NET 8 (LTS) for this guide. It's the Long-Term Support version, supported until November 2026. Look for the big ".NET 8.0" button on the download page.
Choose Your Operating System
| OS | Installer | Notes |
|---|---|---|
| Windows | x64 or Arm64 installer (.exe) | Most users want x64 |
| macOS | x64 or Arm64 installer (.pkg) | Apple Silicon (M1/M2/M3) = Arm64, Intel = x64 |
| Linux | Package manager or binary | Varies by distribution (Ubuntu, Fedora, etc.) |
Step 2: Install the SDK
Windows Installation
- Download the .NET 8 SDK x64 installer (.exe file)
- Run the installer (double-click the downloaded file)
- Click "Install" when prompted
- Wait for installation to complete (usually 1-2 minutes)
- Click "Close" when finished
Windows installs .NET to: C:\Program Files\dotnet\
The installer automatically adds this to your PATH environment variable.
macOS Installation
- Download the appropriate .NET 8 SDK installer (.pkg file)
- Apple Silicon (M1/M2/M3): Download Arm64
- Intel Mac: Download x64
- Open the downloaded .pkg file
- Follow the installation wizard
- Enter your password when prompted
- Click "Install"
macOS installs .NET to: /usr/local/share/dotnet/
The installer creates a symlink in /usr/local/bin/dotnet
Linux Installation (Ubuntu/Debian)
For Ubuntu 22.04 or newer, use the package manager:
# Add Microsoft package repository
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
# Install .NET SDK
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
For Fedora, RHEL, openSUSE, and other distributions, visit: Microsoft's Linux installation guide
Step 3: Verify Your Installation
Let's confirm .NET is installed correctly. Open a new terminal/command prompt and run:
dotnet --version
You should see output like:
8.0.100
If you had a terminal open before installing .NET, close it and open a new one. The PATH environment variable is only updated in new terminal sessions.
Check Installed SDKs and Runtimes
To see all installed .NET versions:
# List installed SDKs
dotnet --list-sdks
# List installed runtimes
dotnet --list-runtimes
Example output:
# SDKs:
8.0.100 [C:\Program Files\dotnet\sdk]
# Runtimes:
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
If you see version numbers, congratulations! .NET is installed and ready to use. You can now create and run .NET applications!
Step 4: Choose Your Development Environment
You can write .NET code in any text editor, but these IDEs provide the best experience:
Option 1: Visual Studio 2022 (Recommended for Windows)
Visual Studio 2022 is the premier IDE for .NET development on Windows. It's feature-rich, powerful, and free (Community Edition).
Download: https://visualstudio.microsoft.com/downloads/
Community: Free for individuals, students, and small teams
Professional: Paid, for professional developers
Enterprise: Paid, for large organizations
For this guide: Community Edition is perfect!
Installing Visual Studio 2022
- Download Visual Studio 2022 Community
- Run the installer
- Select workloads:
- ✅ ASP.NET and web development (essential for InvenTrack)
- ✅ .NET desktop development (optional, for Windows apps)
- Click "Install" (this takes 10-30 minutes depending on your connection)
- Launch Visual Studio when installation completes
• IntelliSense (smart code completion)
• Built-in debugger with breakpoints
• Visual designers for UI
• Integrated Git support
• Database tools
• Performance profilers
• Everything you need in one place!
Option 2: Visual Studio Code (Cross-Platform, Lightweight)
VS Code is a lightweight, fast, cross-platform code editor. Perfect for macOS and Linux users, or Windows users who prefer a lighter tool.
Download: https://code.visualstudio.com/
Setting Up VS Code for .NET
- Install VS Code
- Install the C# Dev Kit extension:
- Open VS Code
- Click Extensions icon (or press
Ctrl+Shift+X) - Search for "C# Dev Kit"
- Click "Install"
- Restart VS Code
C# Dev Kit: Microsoft's official extension pack (recommended)
C# Extension: The older, standalone extension
For this guide: Install C# Dev Kit for the best experience
Option 3: JetBrains Rider (Cross-Platform, Professional)
Rider is a powerful, cross-platform .NET IDE from JetBrains. It's paid but offers a 30-day free trial and free licenses for students.
Download: https://www.jetbrains.com/rider/
Windows + Learning: Visual Studio 2022 Community
macOS/Linux: VS Code or Rider
Professional Work: Visual Studio or Rider
Lightweight/Fast: VS Code
Troubleshooting Common Issues
Issue: "dotnet: command not found"
Cause: .NET is not in your PATH, or you're using an old terminal session.
Solution:
- Close all terminal windows and open a new one
- On Windows, restart your computer if the issue persists
- On macOS/Linux, check if
/usr/local/binis in your PATH
Issue: Wrong .NET Version Installed
Cause: You installed the Runtime instead of the SDK, or an older version.
Solution:
- Run
dotnet --list-sdksto check installed SDKs - If .NET 8 SDK is missing, download and install it from the official site
- Multiple versions can coexist—you don't need to uninstall old ones
Issue: Permission Denied (Linux/macOS)
Cause: Installation requires administrator privileges.
Solution:
- Use
sudofor package manager installations - For .pkg installers on macOS, enter your password when prompted
Issue: Visual Studio Can't Find .NET SDK
Cause: Visual Studio was installed before the .NET SDK.
Solution:
- Restart Visual Studio
- If that doesn't work, repair Visual Studio from the installer
- Worst case: Reinstall Visual Studio
What's Installed: A Quick Tour
Let's explore what the .NET SDK installed on your system:
The dotnet Command
The dotnet command is your gateway to everything .NET. Try these:
# Get help
dotnet --help
# See all available commands
dotnet --list-sdks
dotnet --list-runtimes
# Get .NET info
dotnet --info
Project Templates
The SDK includes templates for common project types:
# List all available templates
dotnet new list
You'll see templates for:
- console: Console application
- webapi: ASP.NET Core Web API
- mvc: ASP.NET Core MVC app
- webapp: ASP.NET Core Razor Pages
- classlib: Class library
- And many more!
You now have .NET installed and ready to go! In the next section, we'll create your first console application, write some C# code, and run it. You'll see the entire development workflow from start to finish!
Key Takeaways
- The .NET SDK includes everything needed for development
- Download from dotnet.microsoft.com/download
- Install .NET 8 (LTS) for this guide
- Verify installation with
dotnet --version - Visual Studio 2022 is recommended for Windows
- VS Code is great for macOS/Linux (and Windows too!)
- The
dotnetCLI is your primary tool for creating and managing projects - Multiple .NET versions can coexist on the same machine
- Always open a new terminal after installation