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
- Xperience by Kentico version: [30.0.0]
- .NET version: 9.0
- Execution environment: Private cloud (Virtual machine)
- https://docs.kentico.com/developers-and-admins/installation/update-xperience-by-kentico-projects
Answers
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 😄.
This issue is now mentioned in the docs for January's Refresh and has been resolved with a hotfix.
To answer this question, you have to login first.