Package downgrade detected when upgrading Xperience by Kentico from 30.0.0 to 30.1.0

When attempting to upgrade the Xperience by Kentico nuget packages of a local site running on .Net 9.0 from version 30.0.0 to 30.1.0, I am receiving the following error:

Detected package downgrade: Microsoft.Extensions.Caching.Memory from 9.0.0 to 8.0.1.

Has anyone else experienced this?


Environment

0

Answers

Accepted answer

There's a very easy workaround for this kind of build error!

You should be able to explicitly add those packages that have a version conflict and set the package version to latest version for .NET 9 (or whatever .NET 9 version of the package you want to use).

Basically, add <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.1" /> to your .csproj files that reference Xperience's NuGet packages.

Why does this work? We don't have upper bounds on transitive package versions for our libraries. A transitive package is one we depend on but you don't have to reference directly (NuGet handles this... most of the time). If you add the explicit package reference to your project you will be fine because you are telling NuGet you know Xperience is asking for an older version than the one .NET 9 implicitly wants to use and to use the .NET 9 version anyway.

If you want to make this kind of dependency management easier, I recommend using Central Package Management in your Xperience projects. The Kentico Community Portal uses it as do all of our Xperience by Kentico open-source integrations.

To resolve this issue we might need to do some multi-targeting of the Xperience packages we publish, but I'll let the product engineering team decide that 😄.

0

Sean, I am seeing this issue again in version 31.2.2. I believe they were introduced by Kentico.Aira.Client.

I can use a similar workaround as you mentioned, however you may want to address this directing in a future release.

Explicitly adding <PackageReference Include="Kentico.Aira.Client" Version="5.5.0" /> to the project seems to have addressed the issue but perhaps Kentico.Xperience.Core should be updated to target this version?

1

Michael/Ryan.

While there's an "easy fix" or workaround, it's actually a bug that I submitted to Kentico Support about 2 weeks ago. I've also asked a similar question here and provided the response that Kentico Support shared with me. The issue will be resolved/released next week I've been told.

1

You can either add the latest Kentico.Aira.Client package to your project and explicitly reference it or add the transitive dependencies that are causing an issue due to multi-targeting.

In the Kentico Community Portal I added the transitive dependencies.

We're aware of the issue and it will be resolved in an upcoming hotfix, as Brenden mentioned.

0

To response this discussion, you have to login first.