From f94d8083a2b9c139eae8b35c73fb97ee4d17de7a Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Mar 2026 09:05:48 -0400 Subject: [PATCH 1/6] Update --- .github/workflows/windows_x86.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 33d6f458002e4..21cd4c384cb6e 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -65,7 +65,7 @@ jobs: working-directory: ${{ github.workspace }} - name: Use .NET 8.x - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v5 with: dotnet-version: '8.x' env: From c44f3ceb32cf710100fe73cd3b1575d0f2fa7623 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Mar 2026 13:52:09 -0400 Subject: [PATCH 2/6] Try force dotnet version --- .github/workflows/windows_x86.yml | 40 ++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 21cd4c384cb6e..281e763cca8bb 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -65,17 +65,55 @@ jobs: working-directory: ${{ github.workspace }} - name: Use .NET 8.x - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@v3 with: dotnet-version: '8.x' env: PROCESSOR_ARCHITECTURE: x86 # x86 .NET + - name: Prefer x86 dotnet on PATH + shell: pwsh + run: | + $x86DotnetDir = 'C:\Program Files (x86)\dotnet' + $x64DotnetDir = 'C:\Program Files\dotnet' + $machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine') + Write-Host "Machine PATH: $machinePath" + + $pathEntries = @($env:PATH -split ';' | Where-Object { $_ }) + $reorderedPathEntries = @( + $x86DotnetDir + $pathEntries | Where-Object { $_ -ne $x86DotnetDir } + ) + + $env:PATH = ($reorderedPathEntries -join ';') + Add-Content -Path $env:GITHUB_PATH -Value $x86DotnetDir + + $dotnetPaths = @(Get-Command dotnet -All | Select-Object -ExpandProperty Source -Unique) + Write-Host 'Resolved dotnet executables:' + $dotnetPaths | ForEach-Object { Write-Host $_ } + + $x86DotnetExe = "$x86DotnetDir\dotnet.exe" + $x64DotnetExe = "$x64DotnetDir\dotnet.exe" + $x86Index = $dotnetPaths.IndexOf($x86DotnetExe) + $x64Index = $dotnetPaths.IndexOf($x64DotnetExe) + + if ($x86Index -lt 0) { + throw "Expected x86 dotnet executable was not found: $x86DotnetExe" + } + + if ($x64Index -ge 0 -and $x86Index -gt $x64Index) { + throw "x86 dotnet must appear before x64 dotnet on PATH. Found $x86DotnetExe after $x64DotnetExe." + } + - name: Use Nuget 6.x uses: nuget/setup-nuget@v2 with: nuget-version: '6.x' + - pwsh: | + where dotnet + + - name: NuGet restore shell: cmd run: | From a400d3eb5266a05db1d89f7254cb1d8a5085b829 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Mar 2026 13:58:10 -0400 Subject: [PATCH 3/6] Update --- .github/workflows/windows_x86.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 281e763cca8bb..ac7d0b5754ca1 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -110,10 +110,11 @@ jobs: with: nuget-version: '6.x' - - pwsh: | + - name: Prefer x86 dotnet on PATH + shell: pwsh + run: | where dotnet - - name: NuGet restore shell: cmd run: | From 9af2f13081896f1ef7ac68cf4d096e154e682221 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Mar 2026 15:45:06 -0400 Subject: [PATCH 4/6] . --- .github/workflows/windows_x86.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index ac7d0b5754ca1..483ad53e0b61e 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -65,7 +65,7 @@ jobs: working-directory: ${{ github.workspace }} - name: Use .NET 8.x - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v5 with: dotnet-version: '8.x' env: @@ -105,16 +105,13 @@ jobs: throw "x86 dotnet must appear before x64 dotnet on PATH. Found $x86DotnetExe after $x64DotnetExe." } + where dotnet + - name: Use Nuget 6.x uses: nuget/setup-nuget@v2 with: nuget-version: '6.x' - - name: Prefer x86 dotnet on PATH - shell: pwsh - run: | - where dotnet - - name: NuGet restore shell: cmd run: | From f9c5e061ff1743382c7368747769b85f6f11cf21 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 11 Mar 2026 17:21:23 -0400 Subject: [PATCH 5/6] Fix --- .github/workflows/windows_x86.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 483ad53e0b61e..ed9ca94372e2b 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -105,8 +105,6 @@ jobs: throw "x86 dotnet must appear before x64 dotnet on PATH. Found $x86DotnetExe after $x64DotnetExe." } - where dotnet - - name: Use Nuget 6.x uses: nuget/setup-nuget@v2 with: From 4f6311e28d2ff14f8127fc14f718da807909f0fa Mon Sep 17 00:00:00 2001 From: eserscor Date: Wed, 11 Mar 2026 17:53:05 -0400 Subject: [PATCH 6/6] Update .github/workflows/windows_x86.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/windows_x86.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index ed9ca94372e2b..897b4f712ffdd 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -86,8 +86,13 @@ jobs: ) $env:PATH = ($reorderedPathEntries -join ';') - Add-Content -Path $env:GITHUB_PATH -Value $x86DotnetDir + # Only add the x86 dotnet directory to GITHUB_PATH if it is not already on PATH (after normalization) + $normalizedX86DotnetDir = $x86DotnetDir.TrimEnd('\') + $normalizedPathEntries = $pathEntries | ForEach-Object { $_.TrimEnd('\') } + if (-not ($normalizedPathEntries -contains $normalizedX86DotnetDir)) { + Add-Content -Path $env:GITHUB_PATH -Value $x86DotnetDir + } $dotnetPaths = @(Get-Command dotnet -All | Select-Object -ExpandProperty Source -Unique) Write-Host 'Resolved dotnet executables:' $dotnetPaths | ForEach-Object { Write-Host $_ }