Search code examples
mauivisual-studio-mac

Workloads installed but not recognized by Visual Studio Mac


I regretfully ran Visual Studio Updates a few days ago, and following the update, I am stuck in a state that does not let me build or debug my .NET MAUI project. When I launch Visual Studio, There is a message that says The solution requires .NET SDK Workloads that are not currently installed. If I click on the Install button, I am asked for my root password but then there is no indication of progress, success, or failure. My package console says the following:

Getting restore information for project /Users/adam/Projects/[redacted]/[redacted]/[redacted].csproj
/usr/local/share/dotnet/sdk/7.0.312/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
To install these workloads, run the following command: dotnet workload restore
Unable to create package spec for project. '/Users/adam/Projects/[redacted]/[redacted]/[redacted].csproj'

Running sudo dotnet workload restore runs successfully but doesn't seem to change anything. If I run dotnet workload list in Terminal, I see the following:

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-tizen                 8.0.3/8.0.100          SDK 8.0.100
maui-maccatalyst           8.0.3/8.0.100          SDK 8.0.100
maui-ios                   8.0.3/8.0.100          SDK 8.0.100
maui-android               8.0.3/8.0.100          SDK 8.0.100
ios                        17.0.8490/8.0.100      SDK 8.0.100
maui                       8.0.3/8.0.100          SDK 8.0.100
android                    34.0.52/8.0.100        SDK 8.0.100

I have tried closing Visual Studio, manually uninstalling each workload via dotnet workload uninstall [workload id], restarting my machine, manually re-installing each workload, restarting my machine again, and opening Visual Studio again but I still see the same error.

Warning tooltip on Solution Explorer

Installed Workload List


Solution

  • I enabled the .NET 8 preview feature as Matt Ward described in the comments and that fixed my problem.