File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
images/windows/scripts/build Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,15 @@ $dotnetToolset = (Get-ToolsetContent).dotnet
9595# Download installation script.
9696$installScriptPath = Invoke-DownloadWithRetry - Url " https://dot.net/v1/dotnet-install.ps1"
9797
98+ # Visual Studio 2022 pre-creates sdk-manifests/8.0.100 folder, causing dotnet-install to skip manifests creation
99+ # https://github.com/actions/runner-images/issues/11402
100+ if (Test-IsWin22 -or Test-IsWin25 ) {
101+ $sdkManifestPath = " C:\Program Files\dotnet\sdk-manifests\8.0.100"
102+ if (Test-Path $sdkManifestPath ) {
103+ Move-Item - Path $sdkManifestPath - Destination $env: TEMP_DIR - ErrorAction Stop
104+ }
105+ }
106+
98107# Install and warm up dotnet
99108foreach ($dotnetVersion in $dotnetToolset.versions ) {
100109 $sdkVersionsToInstall = Get-SDKVersionsToInstall - DotnetVersion $dotnetVersion
@@ -106,6 +115,17 @@ foreach ($dotnetVersion in $dotnetToolset.versions) {
106115 }
107116}
108117
118+ # Replace manifests inside sdk-manifests/8.0.100 folder with ones from Visual Studio
119+ # https://github.com/actions/runner-images/issues/11402
120+ if (Test-IsWin22 -or Test-IsWin25 ) {
121+ if (Test-Path " ${env: TEMP_DIR} \8.0.100" ) {
122+ Get-ChildItem - Path " ${env: TEMP_DIR} \8.0.100" | ForEach-Object {
123+ Remove-Item - Path " $sdkManifestPath \$ ( $_.BaseName ) " - Recurse - Force | Out-Null
124+ Move-Item - Path $_.FullName - Destination $sdkManifestPath - Force - ErrorAction Stop
125+ }
126+ }
127+ }
128+
109129# Add dotnet to PATH
110130Add-MachinePathItem " C:\Program Files\dotnet"
111131
You can’t perform that action at this time.
0 commit comments