Use dotnet script for MAUI workload restore#12370
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the MAUI workload installation logic in both build scripts to use the repository's dotnet.sh/dotnet.cmd wrapper scripts instead of directly referencing the .dotnet folder. This ensures the correct .NET installation is used consistently with the rest of the build process.
Key changes:
- Removed hardcoded
.dotnetfolder paths and environment variable manipulation - Simplified the installation logic to use existing
dotnet.sh/dotnet.cmdwrapper scripts
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/build.sh | Updated to use dotnet.sh wrapper instead of .dotnet/dotnet executable for MAUI workload installation |
| eng/build.ps1 | Updated to use dotnet.cmd wrapper instead of .dotnet/dotnet.exe executable for MAUI workload installation |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12370Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12370" |
|
@mitchdenny looked a bit deeper and I think this is a better setup and follow the pattern in the scripts. Had to go with Should be working now for macOS and Windows! |
|
I think this needs to be plumbed all the way through to the scripts in the root of the repo so that we can use them there. |


Description
Switched the .NET MAUI workload restore portion of the script to use the dotnet script to find the right .NET installation rather than assuming the
.dotnetfolderFixes #12284 (comment)