Reputation: 6458
I'm getting the following error on a .NET Maui project:
Error NETSDK1147 To build this project, the following workloads must be installed:
wasm-tools
To install these workloads, run the following command: dotnet workload restore MyProjectName
C:\Program Files\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.
ImportWorkloads.targets
I've tried the following steps and between each, I closed Visual Studio 2022
and re-opened it every time but to no avail. Some of the messages outputted after running the various command have been included.
Deleted the bin & obj folders for the .net mauid mobile app project
Ran dotnet clean
Ran dotnet restore
Determining projects to restore...
Restored project1
Restored project2 ....
Restored project x
Ran dotnet workload restore
:
Installing workloads
.... installing various other pack/libraries
Successfully installed workload(s) android maui wasm-tools wasm-tools-net7.
Ran dotnet workload install wasm-tools
Workload(s) 'wasm-tools' are already installed.
.... installing various other pack/libraries
Successfully installed workload(s) wasm-tools android maui wasm-tools-net7.
Any ideas what's causing this?
Thanks
Upvotes: 2
Views: 3489
Reputation: 51
It just started happening for while building a Maui project. There was no obvious cause. I am trying running dotnet workload install wasm-tools-net7
then dotnet workload restore
, both from my solution directory. It seems to have fixed it.
You can probably just run dotnet workload restore
Upvotes: 5