From 6d3eb697c1244fc58b17a67c3919b67cd732b5bf Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 4 May 2026 14:34:19 -0500 Subject: [PATCH] Fix dotnet restore hang during prepare step The `dotnet restore` of `package-download.proj` was hanging during the prepare phase, causing all 3 retry attempts to time out after 10 minutes each with zero stdout output. Two issues fixed: 1. Double-quoting of arguments: `ProcessRunner.QuoteArgument()` was called before passing args to the `ProcessRunner` constructor, but the constructor already quotes all arguments via `AddQuotedArgument()`. This caused paths to be wrapped in double quotes (e.g. `"\"/path/to/file\""`), which could cause `dotnet restore` to hang trying to resolve an invalid path. 2. Added `DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true` to the shared pipeline variables so all CI pipelines skip the .NET first-run experience, which can also hang on CI agents. Fixes: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=14008410 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build-tools/automation/yaml-templates/variables.yaml | 2 ++ .../xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index b170d2b8324..2975b8e1a13 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -76,3 +76,5 @@ variables: value: true - name: DOTNET_CLI_TELEMETRY_OPTOUT value: true +- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE + value: true diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs index 01214519f05..cface28e4f6 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs @@ -55,9 +55,9 @@ protected override async Task Execute (Context context) for (int attempt = 1; attempt <= maxAttempts; attempt++) { var logPath = $"{logPathBase}-attempt{attempt}.binlog"; var runner = new ProcessRunner (Configurables.Paths.DotNetPreviewTool, "restore", - ProcessRunner.QuoteArgument (packageDownloadProj), + packageDownloadProj, "--configfile", Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "NuGet.config"), - ProcessRunner.QuoteArgument ($"-bl:{logPath}"), + $"-bl:{logPath}", "--verbosity", "normal" ) { EchoStandardOutput = true,