Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Chocolatey package for 16.0.21299 produces an error on upgrade #62

Open
gregnorz opened this issue Nov 18, 2021 · 1 comment
Open

Comments

@gregnorz
Copy link

The following error is generated by Chocolatey when upgrading dotnet-aspnetcoremodule-v2

- dotnet-aspnetcoremodule-v2 (exited 1) - dotnet-aspnetcoremodule-v2 not upgraded. An error occurred during installation:
 Updating 'dotnet-aspnetcoremodule-v2 15.0.21297' to 'dotnet-aspnetcoremodule-v2 16.0.21299' failed. Unable to find a version of 'dotnet-5.0-windowshosting' that is compatible with 'dotnet-aspnetcoremodule-v2 16.0.21299'

Uninstalling both packages and re-installing manually (first dotnet-aspnetcoremodule-v2, followed by dotnet-5.0-windowshosting) corrected the issue, but this may affect automated updates for users until fixed.

@jberezanski
Copy link
Collaborator

This is correct behavior, even if perhaps surprising.

The ASP.NET Core Module (ANCM) is a single, ever-evolving component, shared by all .NET major.minor versions. All .NET major.minor runtime versions (such as 3.1, 5.0, 6.0) can be installed side-by-side on the same machine, but there is only one ANCM. A given .NET major.minor release corresponds to a range of ANCM versions (e.g. .NET 3.1 has ANCM 13.1., .NET 5.0 has ANCM 15.0.). However, A given ANCM version supports also all earlier .NETs.

Now, the -windowshosting packages (e.g. dotnet-5.0-windowshosting) are metapackages designed so that installing that package ensures that you have all hosting components specifically for .NET 5.0. This means, in particular, that the ANCM is restricted to the .NET 5.0 version range (15.0.*) and its package cannot be upgraded to a version outside of this range (this is the behavior you are seeing), because it would break the promise made by the dotnet-5.0-windowshosting package (the ANCM would not be from .NET 5.0 anymore).

But, being metapackages, the -windowshosting packages do not install anything by themselves; they simply depend on the packages which do the actual installing, in this case: dotnet-5.0-runtime, dotnet-5.0-aspnetruntime and dotnet-aspnetcoremodule-v2 (with version range limit). If you want to have a mix of runtimes, you should not install any -windowshosting package, but the more granular packages.

In other words, if a machine should support multiple .NET versions in IIS, then these packages should be installed:

  • dotnet-X.Y-runtime (or dotnetcore-X.Y-runtime) for each desired .NET X.Y
  • dotnet-X.Y-aspnetruntime (or dotnetcore-X.Y-aspnetruntime) for each desired .NET X.Y
  • dotnet-aspnetcoremodule-v2 (either simply the globally latest version or the version corresponding to the highest .NET X.Y installed on the machine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants