Reputation: 53
I am new to .NET and I have been receiving this error:
"The current .NET MAUI package version '9.0.21' requires the .NET MAUI workload version to be at least '9.0.0'. The current .NET MAUI workload version is '8.0.83'."
I tried the things ChatGPT told me, I have also checked the dotnet version and it is "9.0.101". But the issue still persists and the app won't deploy.
Here's what I have tried: "1. Update the .NET MAUI Workload Run the following commands in your terminal or Developer Command Prompt for Visual Studio:
dotnet workload update
dotnet --version If it’s not .NET 8 (e.g., 8.0.x), download and install the latest .NET 8 SDK from the official .NET website.
Open Visual Studio.
Restore packages:
dotnet restore
dotnet workload list
Look for something like:
Copy code maui-windows 9.0.x maui-android 9.0.x maui-ios 9.0.x If the version is incorrect or missing, reinstall the workload:
dotnet workload install maui"
Upvotes: 5
Views: 2158
Reputation: 6729
Possible cause: Using .net 8 (LTS) with maui 9.
I was getting the mismatch error, 8.0.83
"The current .NET MAUI package version '9.0.21' requires the .NET MAUI workload version to be at least '9.0.0'. The current .NET MAUI workload version is '8.0.83'."
Even after updating the maui workload + and updating to the latest version of VS 2022.
I didn't realize that maui9 required .net 9, and I had my target Framework still set to .net 8.
<TargetFrameworks>net8.0-android</TargetFrameworks>
updating it to
<TargetFrameworks>net9.0-android</TargetFrameworks>
Caused the build to work.
Upvotes: 4
Reputation: 319
The solution for me was to first run:
dotnet workload install maui
I then verified that I had the correct version of the MAUI workload by running:
dotnet workload list
The list showed that I had version 9.0
BUT, when I then tried to update the nuget packages (from maui version 8 to 9.0.27) i got the exact same error.
My solution then was to manually edit the project files and update the versions on the packages that I wanted to update, and then rebuild the project.
Upvotes: 2