Reputation: 925
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?
Upvotes: 3
Views: 15591
Reputation: 519
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)
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
Upvotes: 6
Reputation: 925
As it seems, that folder path has nothing to do with the hosting package.
But what's more important, an IIS that was installed after .NET Core doesn't seem to recognize the AspNetCoreModule(V2) at all. This means, that I always need to install the hosting package, no matter if the IIS is present or not, just to be sure.
Upvotes: 2