Thierry
Thierry

Reputation: 6458

.NET Maui with .NET Core 7.0 - Install wasm-tools

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.

  1. Deleted the bin & obj folders for the .net mauid mobile app project

  2. Ran dotnet clean

  3. Ran dotnet restore

    Determining projects to restore...

    Restored project1

    Restored project2 ....

    Restored project x

  4. Ran dotnet workload restore:

    Installing workloads

    .... installing various other pack/libraries

    Successfully installed workload(s) android maui wasm-tools wasm-tools-net7.

  5. 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

Answers (1)

user23268450
user23268450

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

Related Questions