Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine installed ASP.NET Core Hosting Bundle versions

I've looked around a bit on how to get the versions of the installed ASP.NET Core Hosting Bundles. I know that the "Bundle" consists of the ASP.NET Core Module(V2) for IIS, and the .NET Core Runtime itself.

The Problem is, that I have a ASP.NET Core 2.1 and a ASP.NET Core 3.1 app that need to run on the very same IIS, which is why I need to know if both "bundles" are installed. Most answers around here focus on the .NET Core runtime itself and end on dotnet --info or dotnet --list-runtimes which shows me all the installed runtimes, but iin case of --info only the highest installed "host".

Since some older answers center around the path that dotnet is installed in, I looked that one up, and to my surprise, within %ProgramFiles%\dotnet there is a host folder contianing subfolders with the versions of the bundles that were installed. Within each is a hostfxr.dll.

So my question is, can I determine by that folder structure which versions of the ASP.NET Core Hosting bundles were installed?

like image 413
EaranMaleasi Avatar asked Apr 24 '26 13:04

EaranMaleasi


1 Answers

The path to the Asp.Net Core Module v2 module is:

%Program Files%\IIS\Asp.Net Core Module\V2

The install order of hosting bundles doesn't matter, you can install 5.0 then 3.1 then 2.1 in that order and the module version will be the latest major version from the newest bundle (in this example from 5.0 it will be v15.x)

  • Installing a newer major version of the hosting bundle will update the module
  • Installing a older major version of the hosting bundle will not update or replace the module if an existing newer major version already installed

The module is backwards compatible as far as I can tell. The v15.x module installed by the 5.x hosting bundle works for 3.x, 2.x and 1.x

The version numbers are aligned, 3.x installs module v13.x, 5.x installs module v15 and 6.x installs module 16.x etc.

The command to list the runtimes installed is:

dotnet --list-runtimes

You can view commits affecting the v2 module here https://github.com/dotnet/aspnetcore/commits/main/src/Servers/IIS/AspNetCoreModuleV2

like image 63
Steven Quick Avatar answered Apr 27 '26 02:04

Steven Quick