From 6dae6abc84820e0ff1aeb74230a7954424d5855a Mon Sep 17 00:00:00 2001 From: Nikola Metulev Date: Mon, 23 Nov 2026 15:41:20 -0800 Subject: [PATCH] Keep uno-check on the global.json .NET SDK in CI Runner image windows-2025-vs2026 20261116 ships the .NET 11 SDK (11.0.100). uno-check 1.34.1 requires SDK 10.0.101 (non-exact), and when that exact version is missing it falls back to the newest installed SDK, ignoring global.json. It then installs the .NET 10 workload rollback with the .NET 11 SDK, which fails with a mono toolchain manifest conflict and breaks every Uno (android/ios/macos/wasm) job. Remove SDKs newer than the one global.json selects before running uno-check, so workloads are installed for the SDK the build actually uses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdc07552..72ecfe1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -132,6 +132,18 @@ jobs: - name: Restore dotnet tools run: dotnet tool restore + # uno-check ignores global.json and installs workloads with the newest SDK on the machine. + # Remove SDKs newer than the global.json one so workloads match the SDK we build with. + - name: Remove .NET SDKs newer than global.json + if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' }} + shell: pwsh + run: | + $selected = [System.Management.Automation.SemanticVersion](dotnet --version) + Get-ChildItem (Join-Path $env:DOTNET_ROOT 'sdk') -Directory | + Where-Object { $v = $null; [System.Management.Automation.SemanticVersion]::TryParse($_.Name, [ref]$v) -and $v -gt $selected } | + ForEach-Object { Write-Host "Removing $($_.FullName)"; Remove-Item $_.FullName -Recurse -Force } + dotnet --list-sdks + - name: Run Uno Check to Install Dependencies if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' }} run: > @@ -272,6 +284,16 @@ jobs: - name: Restore dotnet tools run: dotnet tool restore + # See the matching step in the build job. + - name: Remove .NET SDKs newer than global.json + shell: pwsh + run: | + $selected = [System.Management.Automation.SemanticVersion](dotnet --version) + Get-ChildItem (Join-Path $env:DOTNET_ROOT 'sdk') -Directory | + Where-Object { $v = $null; [System.Management.Automation.SemanticVersion]::TryParse($_.Name, [ref]$v) -and $v -gt $selected } | + ForEach-Object { Write-Host "Removing $($_.FullName)"; Remove-Item $_.FullName -Recurse -Force } + dotnet --list-sdks + - name: Run Uno Check to Install Dependencies run: > dotnet tool run uno-check