Community toolkit install is not working

Lloyd Sheen 1,481 Reputation points
2024-04-17T13:38:10.5+00:00

I have had community toolkit installed on this project for quite a while and now it gives the following error when I am trying to update:

Severity Code Description Project File Line Suppression State

Error NU1605 Warning As Error: Detected package downgrade: Microsoft.Maui.Controls.Compatibility from 8.0.14 to 8.0.6. Reference the package directly from the project to select a different version.

NHLMaui -> CommunityToolkit.Maui 8.0.1 -> Microsoft.Maui.Controls.Compatibility (>= 8.0.14)

NHLMaui -> Microsoft.Maui.Controls.Compatibility (>= 8.0.6) NHLMaui C:\VisualStudioProjectsDotNet8\NHLMaui\NHLMaui\NHLMaui.csproj 1

I did an uninstall to see if an install would work other than the update but that gives same error.

I then had to rollback to versions 7 but I have code in the project that uses version 8 functions.

I have been looking at docs etc. in an attempt to install 8 but no luck.

The packages are :

C:\Users\sqlgu.nuget\packages\communitytoolkit.maui\7.0.1\

C:\Users\sqlgu.nuget\packages\communitytoolkit.mvvm\8.2.2\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.picker\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.licensing\25.1.40\

C:\Users\sqlgu.nuget\packages\newtonsoft.json\13.0.3\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.datagrid\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.core\25.1.40\

C:\Users\sqlgu.nuget\packages\microsoft.maui.controls.compatibility\8.0.6\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.buttons\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.carousel\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.inputs\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.listview\25.1.40\

C:\Users\sqlgu.nuget\packages\syncfusion.maui.tabview\25.1.40\

C:\Users\sqlgu.nuget\packages\microsoft.maui.controls\8.0.6\

C:\Users\sqlgu.nuget\packages\microsoft.extensions.logging.debug\8.0.0\

Now the strange thing is that I had the community toolkit version 8 and while updating the nuget packages it gave the error. I also create a new Maui project and added first the Toolkit.Core (no problem). I then tried to install the Toolkit.Maui but get the same errors:

Severity Code Description Project File Line Suppression State

Error NU1605 Warning As Error: Detected package downgrade: Microsoft.Maui.Controls.Compatibility from 8.0.14 to 8.0.6. Reference the package directly from the project to select a different version.

TestToolKit -> CommunityToolkit.Maui 8.0.1 -> Microsoft.Maui.Controls.Compatibility (>= 8.0.14)

TestToolKit -> Microsoft.Maui.Controls.Compatibility (>= 8.0.6) TestToolKit C:\Users\sqlgu\source\repos\TestToolKit\TestToolKit\TestToolKit.csproj 1

Error NU1605 Warning As Error: Detected package downgrade: Microsoft.Maui.Controls from 8.0.14 to 8.0.6. Reference the package directly from the project to select a different version.

TestToolKit -> CommunityToolkit.Maui 8.0.1 -> Microsoft.Maui.Controls (>= 8.0.14)

TestToolKit -> Microsoft.Maui.Controls (>= 8.0.6) TestToolKit C:\Users\sqlgu\source\repos\TestToolKit\TestToolKit\TestToolKit.csproj 1

Error Package restore failed. Rolling back package changes for 'TestToolKit'.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,579 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,061 Reputation points
    2024-04-17T15:40:40.61+00:00

    its pretty simple. the community toolkit needs a version of Microsoft.Maui.Controls.Compatibility >= 8.0.14, but your project is referencing an earlier version. update Microsoft.Maui.Controls.Compatibility nuget package to a version >= 8.0.14 (say the current 8.0.20) in the exe project

    note: to stay current on all security issues, you should check for nuget package updates regularly. it should match your production release cycle (weekly, monthly).


  2. Heikki Kortetmaa 0 Reputation points
    2024-04-28T18:20:37.99+00:00

    I basically have this same Issue: Severity Code Description Project File Line Suppression State

    Error NU1605 Warning As Error: Detected package downgrade: Microsoft.Maui.Controls.Compatibility from 8.0.14 to 8.0.7. Reference the package directly from the project to select a different version.

    APPNAME -> CommunityToolkit.Maui 8.0.1 -> Microsoft.Maui.Controls.Compatibility (>= 8.0.14)

    CommunityToolkit 8.x version requires at least version 8.0.14 from Microsoft.Maui.Controls.Compatibility. I update that version I have tries other versions too but soon it reverses it back to version 8.0.7 in every Targets (android, windows and maccatalyst). Only solution has been to install earlier version of CommunityToolkit (7.x) which works with earlier version of Microsoft.Maui.Controls.Compatibility


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.