Skip to content

Commit 0c54a45

Browse files
committed
Suppress running VS installer
1 parent 3319fea commit 0c54a45

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.ado/templates/prepare-build-env.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ parameters:
3131
# invoked. Example: ['RNTesterApp-Fabric', 'Playground'].
3232

3333
steps:
34+
# The VS Installer's background auto-update service otherwise wakes up mid-build and
35+
# downloads VS updates from the MS CDN, which trips the network isolation policy.
36+
# Follow-up: bake this into the agent image so it doesn't have to run per job.
37+
- pwsh: |
38+
foreach ($key in @(
39+
'HKLM:\SOFTWARE\Microsoft\VisualStudio\Setup',
40+
'HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\Setup')) {
41+
New-Item -Path $key -Force | Out-Null
42+
New-ItemProperty -Path $key -Name BackgroundDownload -PropertyType DWord -Value 0 -Force | Out-Null
43+
}
44+
Get-Process -Name BackgroundDownload -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
45+
displayName: Disable VS Installer background download
46+
3447
# The commit tag in the nuspec requires that we use at least nuget 5.8 (because things break with nuget versions before and Vs 16.8 or later)
3548
- task: NuGetToolInstaller@1
3649
displayName: Set NuGet version

0 commit comments

Comments
 (0)