I’m having trouble installing the .NET MAUI workload on my Mac running macOS. Despite trying different versions of the .NET SDK (8.0.401 and 8.0.400), Visual Studio Code consistently fails to detect the installation.
I was removing all .net installations also using recommended tools from documentation, and installing .net SDK again from scratch. Nothing changed the situation. I have been using "dotnet workload repair" , "dotnet workload clean", "dotnet workload restore", "dotnet workload update", nothing seems to work.
Here are the sample logs always ending with same error
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64 version 7.0.20... Warning: Workload garbage collection failed with error: Workload version 8.0.400-baseline.24375.2 was not found..
When I have SDK 8.0.401 installed, I have had similar error.
I suspect that a previous installation of Visual Studio 2022 (which included .NET 5 and .NET 6) might have left behind some configuration or components that are interfering with the current setup.
Here are the steps
- sudo dotnet workload install maui
- dotnet workload list
Result: No entries on the list. However when I run
"sudo dotnet workload list"
I see:
Installed Workload Id Manifest Version Installation Source
maui 8.0.72/8.0.100 SDK 8.0.400
On VSCode I have the error on.net maui project (created from template)
".NET MAUI SDK: not found. Please check the .NET MAUI output window for more info."
The output looks:
.NET MAUI Workloads:
Path: /usr/local/share/dotnet Version: 8.0.400
Suggested Workloads to be installed:
Workload: maui-ios
Workload: maui-android
.NET MAUI SDK verification failed. Please try running dotnet workload restore
from your project's directory and reopen the solution.
I also get an error from C# dev kit: "Failed to restore solution."
The output looks:
Determining projects to restore...
/usr/local/share/dotnet/sdk/8.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android [/Users/pbaturo/Repos/dotnet-learning/MauiFirstApplication/MauiFirstApplication/MauiFirstApplication.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/sdk/8.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/Users/pbaturo/Repos/dotnet-learning/MauiFirstApplication/MauiFirstApplication/MauiFirstApplication.csproj::TargetFramework=net8.0-android]
I have completely no idea why I have this issue.
Can anyone help me with overcoming this, please?