Skip to main content

.NET SDK Setup and Installation

Level: Beginner

ℹ️ What You'll Learn
  • Download and install .NET SDK
  • Verify installation on Windows, Mac, Linux
  • Understand SDK vs Runtime
  • dotnet CLI basics
  • Set up development environment
  • Check .NET version
ℹ️ What You Need

A computer (Windows, Mac, or Linux) and 500MB free space. Internet connection for download.

SDK vs Runtime — What's the Difference?

Runtime (.NET Runtime)

  • Runs your compiled .NET applications
  • Smaller (100MB)
  • Needed for production servers
  • Cannot build applications

SDK (Software Development Kit)

  • Contains runtime + compiler + tools
  • Larger (500MB+)
  • For developers (you)
  • Can build and compile applications

For learning: Install SDK (includes runtime)

Download .NET SDK

Go to: https://dotnet.microsoft.com/download

Click ".NET 8.0" or latest LTS version.

Choose your operating system:

  • Windows (x64)
  • Mac (Intel or Apple Silicon)
  • Linux (various distributions)

Install on Windows

  1. Download installer (.exe file)
  2. Run installer
  3. Follow prompts (click Next, Accept, Install)
  4. Restart computer (if prompted)

That's it. Installer adds dotnet to system PATH.

Install on Mac

Intel Mac:

  1. Download .dmg file
  2. Open installer
  3. Follow prompts

Apple Silicon (M1/M2/M3):

  1. Choose "Apple Silicon" version
  2. Download .dmg
  3. Install same way

Install on Linux

Different for each distribution.

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install dotnet-sdk-8.0

Fedora:

sudo dnf install dotnet-sdk-8.0

CentOS:

sudo yum install dotnet-sdk-8.0

Verify Installation

Open terminal/command prompt and run:

dotnet --version

Should show:

8.0.0 (or your .NET version)

If command not found:

  • Windows: Restart computer, try again
  • Mac/Linux: Close and reopen terminal

Your First .NET Project

Create folder for project:

mkdir SchoolManagementAPI
cd SchoolManagementAPI

Create console application:

dotnet new console -n SchoolAPI

This creates:

SchoolAPI/
├── bin/
├── obj/
├── SchoolAPI.csproj
└── Program.cs

Run the project:

cd SchoolAPI
dotnet run

Output:

Hello, World!

Congratulations! Your first .NET application ran.

dotnet CLI — Essential Commands

CommandWhat It Does
dotnet new consoleCreate console app
dotnet new webCreate ASP.NET Core web app
dotnet new classlibCreate class library
dotnet buildCompile project
dotnet runRun project
dotnet add package [name]Add NuGet package
dotnet restoreRestore dependencies
dotnet publishCreate production package
dotnet testRun tests

Update .NET SDK

Check for updates:

dotnet sdk check

If update available, reinstall from website.

Multiple .NET Versions

You can install multiple .NET versions (8.0, 9.0, etc.).

Check all installed:

dotnet --info

Shows installed runtimes and SDKs.

Specify version in project:

Edit SchoolAPI.csproj:

<TargetFramework>net8.0</TargetFramework>

Environment Variables

.NET needs no environment variables for basic use.

Advanced: DOTNET_CLI_TELEMETRY_OPTOUT=1 disables telemetry.

IDE Setup

Option 1: Visual Studio (Full IDE)

  • Download from visualstudio.microsoft.com
  • Large, feature-rich
  • Windows and Mac

Option 2: VS Code (Lightweight)

  • Download from code.visualstudio.com
  • Install C# extension
  • Windows, Mac, Linux
  • Recommended for learning

Option 3: Rider (Advanced)

  • JetBrains IDE
  • Paid (but free trial)
  • Powerful, professional

For this course: VS Code recommended

Common Installation Issues

Issue: dotnet command not found

  • Windows: Restart computer
  • Mac/Linux: Check PATH environment variable

Issue: .NET fails to install

  • Check system requirements (Windows 7+ on Windows, OS X 10.12+ on Mac)
  • Ensure 500MB+ free space
  • Try older SDK version

Issue: Multiple versions conflict

  • Each version independent
  • global.json can specify project version
🎯 Interview Favourite

Q: What is the difference between .NET SDK and .NET Runtime, and why do developers need SDK?

Good Answer: "The .NET Runtime is a lightweight component that only runs pre-compiled .NET applications, making it suitable for production servers. The .NET SDK (Software Development Kit) includes the runtime plus additional tools: the C# compiler to compile source code, the dotnet CLI for building and running projects, and dependency management tools like NuGet. Developers need the SDK because they must compile their C# code into MSIL before running it. A production server might only have the runtime installed to save space and reduce attack surface, but developers need the full SDK to write, build, and test applications."

🤖Use AI to Learn Faster

Use ChatGPT, Claude, or Copilot to go deeper on .NET SDK setup and installation. Try these prompts:

  • "How do I install .NET SDK on my operating system?"
  • "What is the difference between .NET SDK and Runtime?"
  • "How do I verify that .NET is installed correctly?"
  • "What dotnet CLI commands do I need to know as a beginner?"

💡 Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" — fastest way to find edge cases and deepen understanding.

Next Article

-> Creating Your First Project

nexcoding.in