Attempt to fix dotnet restore hang during prepare step#11282
Attempt to fix dotnet restore hang during prepare step#11282jonathanpeppers wants to merge 1 commit intomainfrom
dotnet restore hang during prepare step#11282Conversation
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>
There was a problem hiding this comment.
Pull request overview
This PR addresses a CI hang during the prepare phase by ensuring dotnet restore is invoked with correctly quoted arguments and by disabling the .NET first-time experience across pipelines. It fits into the xaprepare/automation infrastructure that bootstraps SDK/tooling dependencies reliably in CI.
Changes:
- Stop pre-quoting arguments passed to
ProcessRunnerinStep_InstallDotNetPreview, avoiding double-quoting on the final command line. - Add
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=trueto shared Azure Pipelines variables to reduce the risk of first-run stalls during restore.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs | Removes explicit QuoteArgument() usage so ProcessRunner performs quoting exactly once. |
| build-tools/automation/yaml-templates/variables.yaml | Adds DOTNET_SKIP_FIRST_TIME_EXPERIENCE to shared pipeline variables to avoid first-run behavior in CI. |
dotnet restore hang during prepare stepdotnet restore hang during prepare step
|
Comparing the old vs new build logs: Old build (14008410) — zero stdout from New build (14010260) — restored in 5 seconds: Can't 100% confirm the quoting fix was the cause vs a transient issue, since the |
Build 14008410 failed during the prepare phase because
dotnet restoreofpackage-download.projtimed out after 10 minutes on all 3 attempts, with zero stdout output — indicating the process was hanging, not just slow.While investigating, we found two things that look wrong and might help:
Double-quoting of arguments:
ProcessRunner.QuoteArgument()was called before passing args to theProcessRunnerconstructor, but the constructor already quotes all arguments viaAddQuotedArgument(). This caused paths to be double-quoted (e.g."\"/path/to/file\"").Missing
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=truein the shared pipeline variables — the first-run experience was triggering on CI (we saw the "Welcome to .NET 11.0!" banner on stderr right before the hang).