Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

Which .NET Core Runtime Download do you need?


:P
On this page:

.NET Core has a number of different runtime downloads that you can grab to install the runtimes and the SDK. It's not immediately obvious what you need, so since I just went through this myself and had a discussion with a few folks at Microsoft (thanks @DamianEdwards and @RowanMiller). I thought I'd summarize if for nothing else than my own reference in the future since I seem to forget what I figured for the last release 😃.

Checking what's installed

The first thing you should probably know is what versions of the runtime and SDKs you have installed, if any. The easiest way to do this is to run the following from a command prompt:

dotnet --info

If that doesn't work and you get an error, it means that .NET Core is not installed at all. dotnet.exe installs as part of a runtime install and puts itself on the path so you should be able to do dotnet --info if it is installed.

dotnet.exe installs with a runtime install, but it only provides core features to provide info to run and application and provide info about the install: dotnet mydll.dll and dotnet --info. To build, publish or do anything else you need to install the SDK.

If .NET Core is installed dotnet --info produces the following output (here with the SDK installed):

The output tells you:

  • The installed SDK version
  • The active runtime version that's running this dotnet command
  • A list of all installed runtimes and SDKs

It's important to understand that you can have multiple runtimes and multiple SDKs installed and each project can use a different one. The runtime is determined by your project's runtime specifier in the .csproj file:

<TargetFramework>netcoreapp2.1</TargetFramework>

The SDK is either the last globally installed SDK which is the default, or you can explicitly override the SDK in a global.json placed in the solution root folder. The following explicitly forces my project to use the last RC SDK, instead of the RTM version:

{
  "sdk": {
    "version": "2.1.300-rc.31211"
  }
}

Generally, there should be no need to use a specific lower SDK version as the SDK is backwards compatible and can compile various versions of .NET Core applicatino back to v1.0. IOW, it's OK to use the latest SDK in almost all cases.

Downloadable Runtimes available

Let's get back to the downloadable installs. There are a number of different things you can download that install .NET Core:

  • .NET Core Runtime
  • .NET Core SDK
  • .NET Core Hosting Bundle
  • Visual Studio

Visual Studio

If you're on a Windows you're very likely to be using Visual Studio and if you have the latest version of Visual Studio installed you are likely to have the latest SDK, runtime as well as the required IIS hosting components installed.

If you're using Visual Studio you typically only need to update the components below if you need to target a specific version of .NET Core that is not already installed. If you're doing active development, the most likely scenario is that you'll be upgrading to the latest version anyway which is most likely going to match what Visual Studio installed.

.NET Core SDK - Install for a Dev Machine

The SDK is meant for non-Visual Studio build and management tasks. That's for command line use or if you're not on Windows specifically. The SDK basically provides what you need for a development setup to build and run .NET Core and all dependencies. The SDK is the largest download and it contains everything you need for a given platform.

Effectively it installs the dotnet.exe build tools along with support components. The SDK also installs a fixed version of the .NET Runtime with it which is required to run the SDK tooling. In other words if you download the latest SDK you typically also get the latest runtimes and you don't have to install the matched runtimes separately.

The versions are .NET Core SDK 2.1.300 and .NET Runtime 2.1.0 as shown in the figure above.

Here's what you see after a clean install of the .NET SDK:

What it contains

  • Specific version of the .NET Core Runtime (ie. 2.1.0)
  • ASP.NET Runtime Packages (Microsoft.AspNetCore.App/All)
  • Specific version of the .NET Core SDK Tools (ie. 2.1.300)
  • The IIS Hosting Components on Windows
  • Platform specific install (ie. x64)

When to install

  • On development machines (all you need typically)
  • On a server or container where you need to run dotnet to build/publish etc. commands
  • On a server if the server builds the application

.NET Core Runtimes

The .NET Core Runtimes are the smallest self-contained and specific component and contain the absolute minimum to run just .NET Core on a specific platform.

Note it a runtime install does not include the ASP.NET Core meta package runtime dependencies, so if your application references Microsoft.AspNetCore.App or Microsoft.AspNetCore.All you have to seperately download the ASP.NET Core package. However, if you explicitly reference all ASP.NET Core Nuget packages rather than using the meta packages, those packages are deployed as part of your application and it can run with just the runtime.

Essentially you are trading installation package size vs. a runtime pre-install requirement.

The runtime alone has no support for dotnet.exe beyond running and info, so you can't build or publish - whatever you use the runtime for has to be a completely pre-compiled and be able to run as is.

Here's what you see after a clean install:

Note that with just the Runtimes, running an ASP.NET Core application fails...

What it contains

  • Specific Runtime for the given platform (ie 2.1.0 for x64)
  • Does not include the ASP.NET Runtimes!

When to use

  • For production installs that include all dependencies
  • For installs that do not use the ASP.NET Meta packages

ASP.NET Core Installer

This package basically installs the missing ASP.NET Runtime meta packages that the base .NET Core Runtime package described in the previous step is missing.

Basically this installs support for the ASP.NET Core meta packages.

What it contains

  • The ASP.NET Runtime Meta Packages
  • Microsoft.AspNetCore.App
  • Microsoft.AspNetCore.All

When to use

  • When you need ASP.NET Meta Packages
  • Install ontop of a raw .NET Core Runtime install

.NET Core Windows Hosting Pack

As you can see so far the SDK and Runtimes by themselves are usually not the right tool for deployed applications because they don't include everything you need and for this reason - at least on Windows there's a special Hosting Pack download that contains everything you need to run an ASP.NET Core application on Windows.

This is perhaps the most confusing of the packages available because the naming doesn't really describe what it provides. You can think of this package as EVERYTHING except the dotnet SDK tools. This package installs both 32 and 64 bit runtimes, the ASP.NET Core Runtimes as well the IIS hosting components on Windows.

If you need the SDK tools you're better of just installing the SDK instead of this package.

Non-Windows Installs

The Windows Hosting pack is specific to Windows and there are no commensurate bundles for Linux or the Mac. On Linux/Mac you can use the SDK download for Dev machines, and .NET Core Runtime + ASP.NET Core Runtimes for typical installations.

What it includes

  • 32 bit and 64 .NET Core Runtimes
  • ASP.NET Runtime Packages (Microsoft.AspNetCode.App/All)
  • IIS Hosting Components

When to use

  • When deploying on Windows Servers and using IIS
  • Includes both 64 and 32 bit runtimes
  • Includes ASP.NET Core Meta Packages
  • Includes the IIS Hosting dependencies
  • When you don't need the dotnet SDK tooling

Download Sizes

To give a quick perspective of what each of these three different SDKs look like (on Windows) in terms of size, here's a screen shot of all three packages:

Download Page

That's a lot of options and frankly every time I install or update a version I forget what exactly I should install.

Microsoft recently updated the download page to make things a little bit easier to understand.

Note the info icons and the included in .NET Core SDK notes, which highlights that if you install the SDK you pretty much get everything.

Summary

To summarize what works best for Windows installs:

For Server Installs

  • Windows: Use the Windows Server Hosting Bundle
  • Mac/Linux: Instal .NET Core Runtime + ASP.NET Core Runtimes

For Development Machines

  • Install the SDK
  • or on Windows: Visual Studio

For absolutely minimal .NET Core Installs

  • Install the Runtime only

If you also use the ASP.NET Runtime Meta packages

  • Install the ASP.NET Runtimes

Hope this helps some of you out.

this post created and published with Markdown Monster
Posted in ASP.NET  .NET  

The Voices of Reason


 

Tune Red Feet
July 03, 2018

# re: Which .NET Core Runtime Download do you need?

Hi Rick,

Thanks for this immaculate summary of Core .Net installation packages!

I happened to install the 'Hosting' package on my web server just 1 day before I stumbled upon your post about it.

And since I prefer to run 64-bits, I added this installation option:

Install Hosting Building Installer (Windows) with option to not install x86 dlls: dotnet-hosting-2.1.1-win.exe OPT_NO_X86=1

Do you think this is a/the good choice for a web server? Or have you chosen a different install on your webserver(s)?


Eric Newton
October 24, 2018

# re: Which .NET Core Runtime Download do you need?

Wow, this is a great breakdown summary and big picture info for NetCore

Thanks for this, Rick!


Adam Cook
December 21, 2018

# re: Which .NET Core Runtime Download do you need?

Hi Rick,

Thank you for your information. Honestly, I'm quite confused which version need to be installed. I test .net Core 2 on my localhost and it works. But, when I deployed to my hosting (Asphostportal), it is not stable. Sometimes it will work fine, but sometimes it will throw an error. Is there a bug on .net core? Just curious.


Ryan
December 27, 2018

# re: Which .NET Core Runtime Download do you need?

Thanks for the excellent breakdown. This is something I have to be mindful of constantly. Our organization leverages several cloud platforms and even has an internal Cloud Foundry implementation. With Cloud Foundry, I find myself constantly having to be mindful of SDKs and runtimes and have to use the global.json to ensure that what I'm building locally can actually be pushed into a Cloud Foundry container based on what dotnet core buildpack has been applied on the servers and what versions of the SDKs it supports.

I know that using the global.json may not be a common use case but it's sure convenient when you need it!


Björn Weström
March 29, 2019

# re: Which .NET Core Runtime Download do you need?

Wow, finally! I have struggled to understand what the difference is between all the different download options for .Net Core and I find that the Microsoft docs are not very clear. After reading this article I now know that the hosting bundle is all I need for the server (since I am serving Web APIs). Thanks a bunch 😃

To clarify - when a server shall host both .Net Core 2.1 applications and .Net Core 2.2 applications, hosting bundles for both versions must be installed, right?


Rick Strahl
March 29, 2019

# re: Which .NET Core Runtime Download do you need?

@Björn - if you have both 2.1 and 2.2 applications you can install only 2.2 as versions will roll forward within the major version (only to 2.99).

But to be safe - yes you'd probably want to have the version you built against installed.


Dima K
May 14, 2019

# re: Which .NET Core Runtime Download do you need?

Thank You for this post "Note the info icons ..." - they should have highlighted those with big red exclamation marks ...


Abdul
June 02, 2019

# re: Which .NET Core Runtime Download do you need?

This is an awesome explanation of the .Net core SDKs & Runtimes


bala
June 04, 2019

# re: Which .NET Core Runtime Download do you need?

Nice article. Just one question , where do I download ASP.NET Core Binaries for RHEL 6 X64 ? I dont see in microsoft official page(https://dotnet.microsoft.com/download/dotnet-core/2.2)


David
May 25, 2020

# re: Which .NET Core Runtime Download do you need?

How does this relate to 3.1 and 3.0, i.e will 3.1 runtime run applications built against 3.0. Are the major versions backward compatible?


Simon
July 13, 2020

# re: Which .NET Core Runtime Download do you need?

Today I figured out that .NET Core SDK includes the runtimes, also for IIS but does not register them in IIS as Modules. For me the AspNetCoreModuleV2 was still missing after installing SDK 3.1.301. I furthermore could not find the aspnetcorev2.dll but only the aspnetcorev2_inprocess.dll in the directory of the sdk. The IIS Modules Folders C:\Program Files (x86)\IIS\Asp.Net Core Module\V2 and C:\Program Files\IIS\Asp.Net Core Module\V2 were not existent. Conclusion: I had to install the Hosting Bundle separetely besides the SDK to get my websites working. Hope this helps for clarification. Can you integrate this in your post Rick?


Sunny Singh
July 14, 2020

# re: Which .NET Core Runtime Download do you need?

I have a question on cross platform architecture of .net core.

So Can I compile the .net core application on Windows and deployed the binaries to Linux? Will it work?Is this the recommended way? I was reading the pluralsight blog https://www.pluralsight.com/tech-blog/dotnet-core-the-good-the-bad-and-the-ugly and here it is mentioned that it will work but it is not recommended.


Rick Strahl
July 14, 2020

# re: Which .NET Core Runtime Download do you need?

@Sunny - yes it's supported - you just have to make sure you set the appropriate build target when you build the application. Also - you can build the application under the Windows SubSystem for Linux which is native Linux so you can build and test the application locally.


Nick
December 18, 2020

# re: Which .NET Core Runtime Download do you need?

Good stuff. Nice presentation. Rick, I have a new application windows 2019 server that's been running two Blazor WASM client/server solutions under aspnet core 3.1 (hosting bundle). I've since updated dev solutions to use aspnet core version 5. Is it ok to leave the 3.1 server hosting bundle, or would you recommend I uninstall 3.1 first? Many thanks


Kruti Joshi
June 14, 2021

# re: Which .NET Core Runtime Download do you need?

Thanks for this explaination!

I also want to clarify another thing - dotnet --info shows me that I have .Net Core SDK 5.0.301 active. To be clear, this should be okay to run apps with target framework .Net Core 2.1 since the SDK would be backward compatible, right?


Rick Strahl
June 15, 2021

# re: Which .NET Core Runtime Download do you need?

@Kruti - Unfortunately the answer is No. .NET Core apps have to have a same major version runtime installed in order to work. Unlike full framework which can run older version binaries, .NET Core requires at least the major version to be the same.

So running a .NET Core 2.x app on .NET Core 5.0 only does not work. Running a .NET 2.0 app on a system that has .NET Core 2.1 installed should work on the other hand. However the reverse is not true - running a 3.1 on a system that only has 3.0 will also not work.


Rick Strahl
June 15, 2021

# re: Which .NET Core Runtime Download do you need?

@Kruti - Here's a post that has more detail about runtime 'roll-forward' functionality: Running .NET Core Apps on a Framework other than Compiled Version?


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024