How to Install .NET SDK: A Step-by-Step Guide


How to Install .NET SDK: A Step-by-Step Guide

If you want to develop applications using C#, ASP.NET Core, or .NET, the first thing you need is the .NET SDK.

The .NET SDK provides the tools required to create, build, run, test, and publish .NET applications from your development machine.

In this guide, you'll learn how to install the .NET SDK on Windows, verify the installation, and create your first .NET application.

What Is the .NET SDK?

The .NET SDK (Software Development Kit) is a collection of tools required to develop .NET applications.

It includes:

  • .NET runtime

  • C# compiler

  • dotnet command-line interface (CLI)

  • Project templates

  • Build tools

  • Testing tools

  • Publishing tools

For example, after installing the SDK, you can use commands such as:

dotnet new console
dotnet build
dotnet run
dotnet test
dotnet publish

You need the SDK if you want to develop .NET applications.

If you only want to run an existing .NET application, you may only need the appropriate .NET Runtime.


.NET SDK vs .NET Runtime

One of the most common beginner questions is:

What is the difference between the .NET SDK and the .NET Runtime?

The .NET Runtime is primarily used to run .NET applications.

The .NET SDK is used to develop .NET applications.

Feature.NET Runtime.NET SDK
Run .NET applications✅✅
Compile C# code❌✅
Create new projects❌✅
Build applications❌✅
Run tests❌✅
Publish applications❌✅
Contains development tools❌✅

If you are learning C# or developing ASP.NET Core applications, install the .NET SDK.


Step 1: Check Whether .NET Is Already Installed

Before installing the SDK, open Command Prompt, PowerShell, or a terminal and run:

dotnet --version

If the SDK is installed, you should see a version number such as:

10.0.xxx

You can also run:

dotnet --info

This displays more detailed information about your .NET installation.

For example, it can show:

.NET SDK:
 Version:   10.0.xxx
 Workload version: ...
 MSBuild version: ...

You can also list all installed SDKs:

dotnet --list-sdks

And installed runtimes:

dotnet --list-runtimes

Step 2: Download the .NET SDK

Go to the official .NET download page from Microsoft.

Download .NET SDK from Microsoft

Choose the SDK version you want to use.

For example, if you are developing applications targeting a particular .NET release, install the corresponding SDK.

Important

Make sure you download the SDK, not just the Runtime.

The download page normally provides separate options for:

  • SDK

  • Runtime

  • ASP.NET Core Runtime

  • Desktop Runtime

For development, choose SDK.


Step 3: Choose the Correct Operating System

The .NET SDK supports multiple operating systems, including:

  • Windows

  • Linux

  • macOS

For this example, we will install it on Windows.

Select the Windows download appropriate for your computer.

Most modern Windows computers use the x64 architecture.

If you are unsure about your system architecture, open:

Settings → System → About

and check the System type.


Step 4: Install the .NET SDK on Windows

After downloading the installer, you should have an installer file similar to:

dotnet-sdk-10.0.xxx-win-x64.exe

The exact filename depends on the SDK version.

Double-click the installer.

You should see the .NET SDK setup window.

Click:

Install

Windows may ask for administrator permission.

Select Yes to continue.

The installer will install the required .NET development components.

When installation finishes, click:

Close


Step 5: Restart Your Terminal

Close any existing Command Prompt or PowerShell windows.

Open a new terminal.

This is useful because environment variables and PATH changes may not be reflected in an already-open terminal.

Now run:

dotnet --version

You should see the installed SDK version.

For example:

10.0.xxx

If you see a version number, the SDK installation was successful.


Step 6: Verify the .NET Installation

Run:

dotnet --info

This displays information about your .NET environment.

You can also run:

dotnet --list-sdks

Example:

8.0.xxx [C:\Program Files\dotnet\sdk]
10.0.xxx [C:\Program Files\dotnet\sdk]

This means multiple .NET SDK versions are installed.

You can also check the installed runtimes:

dotnet --list-runtimes

Step 7: Create Your First .NET Application

Now that the SDK is installed, let's create a simple console application.

Create a directory:

mkdir MyFirstDotNetApp

Move into the directory:

cd MyFirstDotNetApp

Create a new console application:

dotnet new console

You should see output similar to:

The template "Console App" was created successfully.

The SDK creates files such as:

MyFirstDotNetApp
│
├── MyFirstDotNetApp.csproj
└── Program.cs

Step 8: Run the Application

Run:

dotnet run

You should see:

Hello, World!

Congratulations! Your .NET development environment is ready.


Step 9: Build the Application

You can compile the project using:

dotnet build

The dotnet build command restores dependencies if necessary and builds the project.

A successful build should produce output similar to:

Build succeeded.

The compiled files are normally placed under:

bin\Debug\

Step 10: Check the .NET CLI

The .NET SDK includes the dotnet command-line interface.

Run:

dotnet --help

You will see many available commands.

Some of the most commonly used commands are:

dotnet new
dotnet restore
dotnet build
dotnet run
dotnet test
dotnet publish
dotnet clean

dotnet new

Creates a new project.

dotnet new console

dotnet restore

Restores NuGet dependencies.

dotnet restore

dotnet build

Builds the project.

dotnet build

dotnet run

Runs the application.

dotnet run

dotnet test

Runs automated tests.

dotnet test

dotnet publish

Creates files that can be deployed.

dotnet publish

Installing .NET SDK Using Visual Studio

If you use Visual Studio, you can also install the required .NET SDK through the Visual Studio Installer.

Open:

Visual Studio Installer

Select your Visual Studio installation and click:

Modify

Under the available workloads, select the workload appropriate for your application.

For example:

ASP.NET and web development

or

.NET desktop development

The installer can install the required .NET development components.

However, installing the standalone .NET SDK is useful when you want to work primarily from:

  • Command Prompt

  • PowerShell

  • Visual Studio Code

  • JetBrains Rider

  • CI/CD pipelines

  • Build servers


Installing .NET SDK on Linux

The installation process is different depending on the Linux distribution.

Microsoft provides installation instructions for supported Linux distributions.

Install .NET on Linux

After installation, verify it with:

dotnet --version

Installing .NET SDK on macOS

For macOS, Microsoft provides installation instructions for supported versions of macOS.

Install .NET on macOS

After installation, run:

dotnet --version

to verify the SDK.


What If dotnet Is Not Recognized?

Sometimes you may install the SDK successfully but receive an error such as:

'dotnet' is not recognized as an internal or external command

This usually means that the dotnet executable isn't available through your PATH, or the terminal was opened before the SDK was installed.

Try these steps:

1. Close and reopen the terminal

Open a new Command Prompt or PowerShell window.

2. Restart your computer

If the problem continues, restart Windows and try:

dotnet --version

3. Check the .NET installation

On Windows, the standard installation location is commonly:

C:\Program Files\dotnet

4. Reinstall the SDK

If the SDK installation is incomplete, reinstall the appropriate SDK from Microsoft's official download page.


How to Check Multiple .NET SDK Versions

You can install multiple SDK versions on the same computer.

Run:

dotnet --list-sdks

For example:

8.0.xxx
9.0.xxx
10.0.xxx

This is useful when maintaining applications that target different .NET versions.

A project can specify its target framework in the .csproj file.

For example:

<TargetFramework>net10.0</TargetFramework>

Another project might use:

<TargetFramework>net8.0</TargetFramework>

The installed SDKs and the project's target framework are related, but they are not the same thing.


Do You Need Visual Studio to Develop .NET?

No.

You can develop .NET applications using several tools.

For example:

  • Visual Studio

  • Visual Studio Code

  • JetBrains Rider

  • Command-line tools

The .NET SDK is the underlying development toolkit that provides commands such as:

dotnet new
dotnet build
dotnet run

Therefore, you can create and build a .NET application without opening Visual Studio.


Recommended Installation for Beginners

If you are starting .NET development on Windows, a typical setup is:

Windows
   ↓
.NET SDK
   ↓
Visual Studio or VS Code
   ↓
C#
   ↓
.NET / ASP.NET Core

After installing the SDK, you can start experimenting with:

dotnet new console

or create an ASP.NET Core Web API:

dotnet new webapi

Then run:

dotnet run

Common Commands After Installing .NET SDK

Here is a quick reference:

CommandPurpose
dotnet --versionDisplay the active SDK version
dotnet --infoDisplay detailed .NET information
dotnet --list-sdksList installed SDKs
dotnet --list-runtimesList installed runtimes
dotnet newCreate a project
dotnet restoreRestore dependencies
dotnet buildBuild a project
dotnet runRun a project
dotnet testRun tests
dotnet publishPrepare an application for deployment
dotnet cleanClean build output

Conclusion

Installing the .NET SDK is the first step toward developing C#, .NET, and ASP.NET Core applications.

The basic process is:

Download .NET SDK
       ↓
Install the SDK
       ↓
Open a new terminal
       ↓
Run dotnet --version
       ↓
Create a project
       ↓
dotnet new console
       ↓
dotnet run

Once the SDK is installed, you have everything you need to start creating .NET applications from the command line.

The most important commands to remember are:

dotnet --version
dotnet new
dotnet build
dotnet run

If dotnet --version returns a valid SDK version and dotnet run successfully executes your application, your basic .NET development environment is ready.

Home

Looking for 1:1

Comments

Popular posts from this blog

How to Install .NET 10 SDK on Windows, Linux, and macOS

Microsoft Agent Framework Explained: A .NET Developer’s Architecture Guide

Why Is Your ASP.NET Core API Using So Much Memory? 7 Causes and Fixes