.NET SDK vs .NET Runtime

When setting up a .NET environment, two essential components often come up: the .NET SDK and the .NET Runtime. Although they work together, they serve completely different roles in the application lifecycle.

Understanding this difference helps developers install the right tools, configure machines correctly, and avoid common setup mistakes.


What Is the .NET Runtime?

The .NET Runtime is the execution environment responsible for running .NET applications. It acts as a managed layer between your application and the operating system, ensuring that code executes safely and efficiently.

When an application starts, the runtime:
  • Loads required assemblies
  • Converts Intermediate Language (IL) into native machine code
  • Manages memory through garbage collection
  • Handles exceptions and security

Without the runtime, a .NET application simply cannot execute.

Example Scenario:

Imagine downloading a reporting tool built with .NET. To use the software, your machine only needs the runtime — not the full development toolkit — because you are running the application, not building it.

For this reason, production servers typically install only the runtime. It keeps environments lightweight while still supporting reliable execution.


What Is the .NET SDK?

The Software Development Kit (SDK) provides everything developers need to create, build, test, and publish .NET applications.

It includes:
  • The .NET Runtime
  • Command-line tools (CLI)
  • Project templates
  • The compiler
  • Build and packaging utilities

Think of the SDK as a complete toolkit designed for developers.


From Where Do You Install the .NET SDK?

The .NET SDK can be downloaded from the official Microsoft website:

👉 https://dotnet.microsoft.com/en-us/download/dotnet

When visiting the page, you’ll typically see multiple options such as:
  • .NET SDK
  • .NET Runtime
  • ASP.NET Runtime

Always choose the SDK if you plan to develop applications.

Installation Steps
  1. Select your operating system (Windows, macOS, or Linux).
  2. Download the latest SDK version (for example, .NET 8 SDK).
  3. Run the installer and complete the setup.
  4. Verify installation using a terminal.

After installation, confirm it works by running:


dotnet --version

If a version number appears, the SDK has been installed successfully.


Where Do You Run .NET CLI Commands?

All dotnet commands are executed inside a terminal or command prompt, not inside C# files.

Depending on your operating system, you can use:

Windows
  • Command Prompt
  • PowerShell
  • Windows Terminal
macOS
  • Terminal
Linux
  • Bash or any shell terminal

Once the SDK is installed, the dotnet CLI becomes available globally on your system.


Where Does Visual Studio Fit?

Many developers use Visual Studio to build .NET applications. However, Visual Studio does not replace the SDK — it relies on it.

When installing Visual Studio with the .NET development workload, the required SDK is automatically installed.

Visual Studio internally uses the SDK to:
  • Create projects
  • Compile code
  • Restore NuGet packages
  • Build and debug applications

Developers who prefer lightweight environments can use Visual Studio Code with the .NET CLI. Regardless of the editor, the SDK remains the core requirement.


Key Differences Between .NET SDK and .NET Runtime

.NET SDK .NET Runtime
Used to develop applications Used to run applications
Includes build tools, compiler, and CLI Does not include build tools
Installed on developer machines Installed on user or server machines
Contains the runtime Cannot build applications independently

Why This Difference Matters

Confusing the SDK with the runtime can cause setup problems:
  • Installing only the runtime on a developer machine prevents building projects.
  • Installing the SDK unnecessarily on production servers increases system footprint.

Summary

The .NET SDK and .NET Runtime serve complementary roles in the software lifecycle. The SDK equips developers with the tools needed to build applications, while the runtime provides the environment required to execute them.

Visual Studio enhances development but still relies on the SDK behind the scenes.

Build with the SDK. Run with the runtime. Together, they power every modern .NET application.