What's the difference between SDK and Runtime in .NET Core?

mohammad rostami siahgeli picture mohammad rostami siahgeli · Dec 9, 2017 · Viewed 36.1k times · Source

I've read many articles, including this one, yet I can't still figure out what's the difference, and they have not explained it either in simple terms or at all.

Can someone please clarify what's the difference between .NET SDK and .NET Runtime?

Update: Using comparisons would be very appreciated. Analogy alongside simple English is highly educational.

Answer

OrdinaryOrange picture OrdinaryOrange · Apr 7, 2018

According to the .Net Core Guide, .NET Core is composed of the following items

  • A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services.
  • A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.
  • A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
  • The 'dotnet' app host, which is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.

The SDK is all of the stuff that is needed/makes developing a .NET Core application easier, such as the CLI and a compiler.

The runtime is the "virtual machine" that hosts/runs the application and abstracts all the interaction with the base operating system.

Only the latter is required to run the application, but the former is needed to develop the application.