[windows-2025] Fix .Net 8 SDK installation (#11564)

This commit is contained in:
Shamil Mubarakshin
2025-02-10 16:32:32 +01:00
committed by GitHub
parent 13666fe265
commit 3b91a7827b

View File

@@ -97,7 +97,7 @@ $installScriptPath = Invoke-DownloadWithRetry -Url "https://dot.net/v1/dotnet-in
# Visual Studio 2022 pre-creates sdk-manifests/8.0.100 folder, causing dotnet-install to skip manifests creation # Visual Studio 2022 pre-creates sdk-manifests/8.0.100 folder, causing dotnet-install to skip manifests creation
# https://github.com/actions/runner-images/issues/11402 # https://github.com/actions/runner-images/issues/11402
if (Test-IsWin22 -or Test-IsWin25) { if ((Test-IsWin22) -or (Test-IsWin25)) {
$sdkManifestPath = "C:\Program Files\dotnet\sdk-manifests\8.0.100" $sdkManifestPath = "C:\Program Files\dotnet\sdk-manifests\8.0.100"
if (Test-Path $sdkManifestPath) { if (Test-Path $sdkManifestPath) {
Move-Item -Path $sdkManifestPath -Destination $env:TEMP_DIR -ErrorAction Stop Move-Item -Path $sdkManifestPath -Destination $env:TEMP_DIR -ErrorAction Stop
@@ -117,7 +117,7 @@ foreach ($dotnetVersion in $dotnetToolset.versions) {
# Replace manifests inside sdk-manifests/8.0.100 folder with ones from Visual Studio # Replace manifests inside sdk-manifests/8.0.100 folder with ones from Visual Studio
# https://github.com/actions/runner-images/issues/11402 # https://github.com/actions/runner-images/issues/11402
if (Test-IsWin22 -or Test-IsWin25) { if ((Test-IsWin22) -or (Test-IsWin25)) {
if (Test-Path "${env:TEMP_DIR}\8.0.100") { if (Test-Path "${env:TEMP_DIR}\8.0.100") {
Get-ChildItem -Path "${env:TEMP_DIR}\8.0.100" | ForEach-Object { Get-ChildItem -Path "${env:TEMP_DIR}\8.0.100" | ForEach-Object {
Remove-Item -Path "$sdkManifestPath\$($_.BaseName)" -Recurse -Force | Out-Null Remove-Item -Path "$sdkManifestPath\$($_.BaseName)" -Recurse -Force | Out-Null