Search code examples
c#.netmauiworkload

.Net MAUI app not building due to missing workload but the workload is installed


I installed .net maui through visual studio 2022 and created a new project. The template is there, it all looks fine. Until I go to build and debug the app on my windows machine. No changes were made to the project but it throws this error: NETSDK1147: To build this project, the following workloads must be installed: maui-windows.

The workload is installed though: dotnet workload list

Tried running the dotnet workload restore in the visual studio project terminal but it failed: Failing to build and restore workload

Tried to install all maui workloads again: workload installed

Tried to repair workloads: workloads repaired

Still doesn't want to bulid the app. Not sure what else to try.


Solution

  • Ok after all these steps, all I had to do was restart the Visual Studio app and reopen the solution. Works like normal.

    Most likely fix for this was the repair command; before I tried that, I already restarted the system without luck.

    Sorry for bothering and hopefully I try turning it off and on again before asking a question lol.