MAUI "NETSDK1147: install the following workloads: maui" in CI
Building a .NET MAUI project needs the maui workload (or a platform workload like maui-android). A clean CI SDK does not ship it, so the build fails with NETSDK1147 and the exact dotnet workload install command.
What this error means
dotnet build of a MAUI project fails with "error NETSDK1147: To build this project, the following workloads must be installed: maui" plus the install command to run.
error NETSDK1147: To build this project, the following workloads must be installed: maui
To install these workloads, run the following command: dotnet workload install mauiCommon causes
The MAUI workload is not on the runner
Hosted images include the SDK but not the optional MAUI workload, which provides the Android, iOS, and platform build targets.
Workload band does not match the pinned SDK
A workload installed for a different SDK band is not picked up, so the build still reports the workload as missing.
How to fix it
Install the maui workload in CI
- Run
dotnet workload install mauiafter setup-dotnet. - For a single platform, install the narrower workload (for example
maui-android). - Build after the workload is present.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- run: dotnet workload install maui
- run: dotnet build -c ReleaseRestore workloads from the project
Let the SDK install exactly the workloads the project requires.
dotnet workload restoreHow to prevent it
- Install the MAUI workload as a CI step before build.
- Match the workload to the pinned SDK band via global.json.
- Install only the platform workloads you build to save time.