Difference Between .NET SDK And .NET Runtime

Microsoft .NET is a software framework that is used to build, run, and deploy applications across multiple platforms. It includes a rich class library, compilers, metadata, and several application models for building both standalone and hosted applications on the web.

It has an extensive SDK with toolsets for all major development activities in Windows desktop & mobile apps, websites, cloud services, games and multimedia.

On the other hand, a runtime is a software component that implements the execution model of a programming language. It loads and links pre-compiled code from external libraries or generates intermediate code dynamically during program run time. It’s responsible for reading an application’s instructions – e.g., from source code or an intermediate language (e.g., bytecode) – and performing operations on the data to make it accessible to code which follows these instructions, typically using a suitable virtual machine.

It is important to note that the .NET SDK is not needed to run an actual .NET application. To run the app we only need the .NET Runtime package.

.NET Runtime

Let’s take a look at the two commands below. The first one checks the .NET SDK version and the second one checks the .NET Runtime version. As shown the versions are different.

IT is a common practice to only install the runtime library on the server that will host the application because it provides an extra security layer and reduces the attack surface and patching cycle.

dotnet --list-sdks   
5.0.402 [/usr/share/dotnet/sdk]
dotnet  --list-runtimes 
Microsoft.AspNetCore.App 5.0.11
Microsoft.NETCore.App 5.0.11

If you follow the release cycle of the .NET framework you will see that sometimes the SDK and Runtime get different updates.