Skip to content

Fix coordinated .NET build path casing that breaks Blazor WebAssembly builds - #21623

Merged
Karol Zadora-Przylecki (karolz-ms) merged 9 commits into
mainfrom
fix/coordinated-build-failure-diagnostics
Nov 3, 2026
Merged

Karol Zadora-Przylecki (karolz-ms) merged 9 commits into
mainfrom
fix/coordinated-build-failure-diagnostics

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes #21621. Part of the flake-zero effort in #21600.

Problem. In #21621 (VS Code Windows browser-debugger E2E), standalone-gateway goes FailedToStart right after the coordinated build __dotnet-project-build-2 exits non-zero. Frequency over 7 days: 3 of 192 browser-debugger jobs, including 1 of 20 main runs. The real build error was not visible anywhere, so this PR first makes it visible and then fixes it.

Root cause. The diagnostics added in this PR captured the real error on this PR's own CI (run 41260248165, artifact extension-e2e-diagnostics-win-x64-browser-debugger-attempt1):

[FAIL] [AppHost/DotnetProjectBuildCoordinator] The coordinated .NET build failed with exit code 1 ... __dotnet-project-build-2
Microsoft.NET.Sdk.WebAssembly.Browser.targets(532,5): error : Source file 'C:\Users\...\HostedPerPage.Client\obj\Debug\net11.0\_framework\HostedPerPage.Client.cr0442jzk4.pdb' does not exist for framework asset materialization. [c:\Users\...\HostedPerPage.Client.csproj]

The error path uses C:\, but the project path uses c:\.

  • The coordinated build's paths come from the AppHost directory. That directory comes from the AppHostProjectPath metadata, which keeps whatever spelling the AppHost was built with. Under VS Code on Windows, that spelling can be the lowercase drive letter c:\.
  • In the static web assets SDK, DefineStaticWebAssets.ComputeCandidateIdentity checks candidateFullPath.StartsWith(contentRoot) with case-sensitive (ordinal) comparison. When the casing differs, the SDK builds an identity from the content root plus _framework/<name>.<fingerprint>.pdb. That file doesn't exist, so MaterializeFrameworkAsset fails the Blazor WebAssembly client build.

Correlation. I compared the drive-letter casing of __dotnet-project-build-2 (dotnet build <c|C>:\...\projects.<hash>.proj -mt) against the outcome in Windows browser-debugger E2E runs:

Build 2 drive letter Runs FailedToStart
lowercase c:\ 4 4
uppercase C:\ 13 0

Fix.

  1. Root cause: DotnetProjectBuildResource now resolves the on-disk casing of every path it gives MSBuild: the working directory, build directory, project paths and step working directories. That casing also reaches the launched project's path. Directories that don't exist yet are resolved from their deepest existing ancestor. The fix doesn't resolve symlinks, so the existing symlink-spelling behavior is unchanged. On case-insensitive file systems, case-variant spellings of one project still deduplicate to one entry, but that entry now uses the on-disk spelling instead of the first caller's spelling. CaseVariantProjectPathsFollowFilesystemIdentity was updated to assert this.
  2. Diagnostics: when the coordinated build fails:
    • The coordinator reads the build output, bounded to 10s and best-effort.
    • It extracts the MSBuild error lines, or the last 20 output lines if there are none.
    • It appends them to the dependent's exception and logs them once per build attempt to the AppHost logger, so they reach CLI logs and the E2E artifacts.
    • It keeps a log subscriber from build start until the build settles, so DCP drains the final output before the terminal state.

Evidence

Regression tests in DotnetProjectBuildCoordinatorTests:

Test Before fix After fix
CoordinatedBuildPathsUseOnDiskCasing (Windows/macOS; casing-insensitive file systems) ❌ on Windows CI at 2835be7 (test-only commit): Expected: "C:\\Users\\runneradmin..." Actual: "c:\\Users\\runneradmin..." (job) ✅
FailedCoordinatedBuildReportsBuildErrorsToDependentsAndAppHostLogOnce ❌ Not found: "/src/Api/Program.cs(3,1): error CS1002..." ✅
FailedCoordinatedBuildWithoutErrorLinesReportsBuildOutputTail ❌ Not found: "build output line 05" ✅
FailedCoordinatedBuildStillFailsDependentWhenBuildOutputIsUnavailable (guards the fallback) ✅ ✅
CoordinatedBuildKeepsOutputSubscribedUntilBuildSettles (review feedback) ❌ Assert.True() Failure ✅

The full DotnetProjectBuildCoordinatorTests class passes on Linux: 128 passed, 1 skipped (the casing test is skipped because Linux file systems are case-sensitive).

Real DCP (playground/DotnetProject AppHost with a compile error injected):

  • Before, on main: 0 console lines about the build failure.
  • After: exactly 1 fail: Aspire.Hosting.Dotnet.DotnetProjectBuildCoordinator record, containing Greeter.cs(13,78): error CS0103: The name 'NotAType' does not exist in the current context.

E2E: the Windows browser-debugger E2E job on this PR is the functional check; see the CI results.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No

🤖 Posted by AspireAgent (AI Agent)

When the coordinated `dotnet build` fails, dependents fail with
"See resource '__dotnet-project-build' for build output." but the build
output only lives in the hidden build resource's console log. CLI logs,
E2E artifacts and the dependent's error never contain the actual MSBuild
error, which made #21621 undiagnosable.

On failure, read the build resource's console output (best effort,
bounded), include the MSBuild error lines (or the last 20 lines when no
error line is present) in the dependent's DistributedApplicationException
and log the failure once to the AppHost logger.

Contributes to #21621.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21623

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21623"

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 1, 2026 00:05
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 1, 2026
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Build diagnostics can miss late compiler errors after terminal notification, while shared-build failures redundantly download and parse the full log for every dependent.

2 open issues
What changed in this PR

Surfaces coordinated .NET build failures in dependent resource exceptions and AppHost logs, helping diagnose #21621 without claiming to fix its underlying cause.

Changes:

  • Adds bounded, best-effort output collection with timestamp removal, deduplicated errors, and a tail fallback.
  • Logs failures once per settled build snapshot.
  • Adds regression tests for error reporting, tail selection, and unavailable logs.
File Description
tests/​Aspire.Hosting.Dotnet.Tests/​DotnetProjectBuildCoordinatorTests.cs Tests diagnostic extraction, dependent exceptions, and once-only logging.
src/​Aspire.Hosting.Dotnet/​DotnetProjectBuildCoordinator.cs Collects build output and reports failures through exceptions and AppHost logging.
src/​Aspire.Hosting.Dotnet/​Aspire.Hosting.Dotnet.csproj Includes the shared console timestamp parser.

Review effort: Balanced

Address review feedback: read the failed build's output once per build attempt
and keep a log subscriber on the build resource from start until it settles so
DCP drains final compiler output before publishing the terminal state.

Co-authored-by: Copilot <[email protected]>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A metadata-only update can change the shared-task cache key without a new build, causing dependents to download logs again and emit duplicate AppHost errors for the same failed attempt.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Key shared build tasks by build-attempt generation

src/​Aspire.Hosting.Dotnet/​DotnetProjectBuildCoordinator.cs:216

A metadata-only update can replace the settled snapshot without starting a new build: ResourceHealthCheckService.FireResourceReadyEvent publishes such an update after its asynchronous callback completes, even if the build has since finished. Dependents waiting before and after that update use different cache keys, so the same failed attempt can trigger another log download and AppHost error. Key the shared task by resource and build-attempt generation instead, and add a regression test with a metadata-only update between dependent waits.

2 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Regression test for #21621; expected to fail on Windows/macOS before the fix.

Co-authored-by: Copilot <[email protected]>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new test fails on Windows and macOS because its case-sensitive assertions expect path normalization that the production code does not perform.

1 open issue

Review effort: Balanced

The AppHost directory can carry a lowercase drive letter (VS Code on Windows).
The static web assets SDK compares content roots ordinally, so mixed casing makes
Blazor WebAssembly builds synthesize nonexistent framework asset paths and fail.
Resolve on-disk casing for all paths handed to the coordinated build.

Fixes #21621

Co-authored-by: Copilot <[email protected]>
@davidfowl David Fowler (davidfowl) changed the title Surface coordinated .NET build errors in AppHost logs Fix coordinated .NET build path casing that breaks Blazor WebAssembly builds Nov 1, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 1, 2026 02:23
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The existing CaseVariantProjectPathsFollowFilesystemIdentity theory expects input-path casing and fails on case-insensitive filesystems because normalization now returns the on-disk spelling.

2 open issues

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Path canonicalization breaks coordinator tests with lowercase %TEMP% drive letters, while startup failure reporting, Unicode path consistency, and failure-log retention also have unresolved defects.

5 open issues
3 resolved since last review

Review effort: Max

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

- Resolve combined case + Unicode normalization aliases in PathNormalizer.
- Reconcile a file app's metadata path and default working directories when
  the source file is created after registration.
- Start the shared failure report when the build resource stops, so
  explicit-start projects without dependents still log the AppHost summary.
- Keep the newest build output tail by DCP timestamp instead of delivery order.
- Resolve fixture root casing in tests that compare build working directories.

Co-authored-by: Copilot <[email protected]>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A restart from an earlier ResourceStoppedEvent handler can cache an old failure under the new attempt, causing a failed retry to report the wrong exit code and suppress its own summary.

1 open issue
5 resolved since last review

Review effort: Max

An earlier ResourceStoppedEvent handler can restart the build before the
coordinator's handler runs, advancing the attempt. Read the attempt before
the current snapshot and report only when that snapshot is still a settled
failure, so a stale stop never caches the old exit code for the new attempt.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Tests selector

54 / 100 PR test projects · 6 PR jobs, from 7 changed files.

Selected PR test projects (54 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Native.Core.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (6)

cli-starter-validation, extension-e2e, homebrew-installer, polyglot, typescript-api-compat, winget-installer


How these were chosen — grouped by what changed

⚠️ 35 of the 54 selected test projects come from a single change — src/Shared/PathNormalizer.cs.

🔧 src/Shared/PathNormalizer.cs (changed source)
→ 35 via the project graph

show 35

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Browsers.Tests (2 hops), Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.Containers.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.Go.Tests (2 hops), Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.MongoDB.Tests (2 hops), Aspire.Hosting.MySql.Tests (2 hops), Aspire.Hosting.Native.Core.Tests, Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.PostgreSQL.Tests (2 hops), Aspire.Hosting.Python.Tests (2 hops), Aspire.Hosting.RabbitMQ.Tests (2 hops), Aspire.Hosting.Redis.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.SqlServer.Tests (2 hops), Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🔧 src/Aspire.Hosting.Dotnet/Aspire.Hosting.Dotnet.csproj (changed source)
→ 3 directly: Aspire.Cli.EndToEnd.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Templates.Tests
→ 15 via the project graph

show 15

Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (2 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests

🔧 src/Aspire.Hosting.Dotnet/DotnetProjectBuildCoordinator.cs (changed source)
→ 3 directly: Aspire.Cli.EndToEnd.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Templates.Tests

🔧 src/Aspire.Hosting.Dotnet/DotnetProjectBuildResource.cs (changed source)
→ 3 directly: Aspire.Cli.EndToEnd.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Templates.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

📦 affected project Aspire.Hosting.Native.Server
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Utils/PathNormalizerTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj (changed test)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

🧪 tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectBuildCoordinatorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

Job reasons

Job Triggered by
cli-starter-validation • src/Aspire.Hosting.Dotnet/Aspire.Hosting.Dotnet.csproj, src/Aspire.Hosting.Dotnet/DotnetProjectBuildCoordinator.cs, src/Aspire.Hosting.Dotnet/DotnetProjectBuildResource.cs
• affected project Aspire.Hosting.Native.Server
• affected project Aspire.Hosting.Dotnet
extension-e2e • src/Aspire.Hosting.Dotnet/Aspire.Hosting.Dotnet.csproj, src/Aspire.Hosting.Dotnet/DotnetProjectBuildCoordinator.cs, src/Aspire.Hosting.Dotnet/DotnetProjectBuildResource.cs
• affected project Aspire.Hosting.Native.Server
• affected project Aspire.Hosting.Dotnet
homebrew-installer affected project Aspire.Hosting.Native.Server
polyglot • affected project Aspire.Hosting.Dotnet
• affected project Aspire.Hosting.Azure.Provisioning.KeyVault
typescript-api-compat affected project Aspire.Hosting.Dotnet
winget-installer affected project Aspire.Hosting.Native.Server

Selection computed for commit fbe4088.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is needed to evaluate unresolved edge cases in build-failure reporting, path-casing consistency, and retry diagnostics.

No open issues 🎉

1 resolved since last review

Review effort: Max

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@karolz-ms

Copy link
Copy Markdown
Contributor

Looking good. Will do PR testing on this and if no issues, we can merge.

@karolz-ms

Copy link
Copy Markdown
Contributor

PR Testing Report

PR Information

  • PR: microsoft/aspire#21623
  • Title: Fix coordinated .NET build path casing that breaks Blazor WebAssembly builds
  • Tested head: fbe4088ea48139044e9963197d2f024d42aefd6b
  • Tested at: 2026-11-03, completed at approximately 17:08 UTC
  • Local environment: macOS arm64, case- and Unicode-normalization-insensitive filesystem, .NET SDK 11.0.100-rc.2.26504.105

Result: the PR-specific scenarios passed on the latest head. The local coordinator suite still has two failures that reproduce identically before this PR; those failures are reported below, not counted as passes.

The earlier, pre-pause results at f18d0cb6 are not being used as validation of the updated implementation. The coordinator suite, affected shared-path tests, supplementary boundary tests, and dogfood scenarios were run again for fbe4088e.

Artifact Version Verification

Item Observed identity Result
Isolated source checkout fbe4088ea48139044e9963197d2f024d42aefd6b Verified
Installed native CLI 17.0.0-pr.21623.gfbe4088e Verified with the installed binary's --version
Hosting packages and AppHost SDK in the downloaded PR hive 17.0.0-pr.21623.gfbe4088e Verified from package metadata
Artifact build CI run 41551900037 Latest-head run, completed successfully
Package repository commit 90483ea59e4fea208ab98c8bb3133bdfbc895d30 Verified as the CI merge commit whose second parent is fbe4088ea48139044e9963197d2f024d42aefd6b

The CLI was installed with the PR's dogfood script into an isolated prefix, using only the documented isolation flags:

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh \
  | bash -s -- 21623 \
      --install-path /private/tmp/aspire-pr21623.8vfQuS/cli-latest \
      --skip-path --skip-extension

Result: installation succeeded. The installer reported the actual executable at cli-latest/dogfood/pr-21623/bin/aspire; that executable, rather than a global aspire, was used throughout.

No CLI version, channel, or commit identity override was supplied. The NuGet service-index override was used only to route public packages through the approved proxy.

Changes Analyzed

Files Changed

  • src/Aspire.Hosting.Dotnet/Aspire.Hosting.Dotnet.csproj
  • src/Aspire.Hosting.Dotnet/DotnetProjectBuildCoordinator.cs
  • src/Aspire.Hosting.Dotnet/DotnetProjectBuildResource.cs
  • src/Shared/PathNormalizer.cs
  • tests/Aspire.Cli.Tests/Utils/PathNormalizerTests.cs
  • tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj
  • tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectBuildCoordinatorTests.cs

Change Categories

  • Hosting build coordination, path spelling, and failure diagnostics.
  • Shared path normalization used by the CLI and hosting.
  • Regression tests, including the review fixes for chronological output tails, explicit-start resources, stopped-event/restart races, and file apps created after registration.

No dashboard, template, client integration, extension, or CI infrastructure files changed.

Test Scenarios Executed

1. Latest-head coordinator regression suite

Objective: exercise coordinated builds, on-disk path casing, duplicate project identity, file-app aliases and rebuilds, diagnostic sharing, cancellation, retry generations, and the newly added review-fix regressions.

Status: 153 passed, 2 failed, 0 skipped. Every changed/new PR regression case passed. The two failures are the pre-existing cold-restore cases described in the baseline comparison.

From the physical path of the isolated PR checkout:

dotnet test --project tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj \
  --no-launch-profile -- \
  --filter-class '*.DotnetProjectBuildCoordinatorTests' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true' \
  --report-trx --results-directory "$EVIDENCE/latest-coordinator-results"

Command result: exit code 2; 155 cases executed. No quarantined or outerloop tests were opted in.

Confirmed passing cases include:

  • CoordinatedBuildPathsUseOnDiskCasing
  • FileAppCreatedAfterRegistrationUsesFinalPathSpellingForLaunchAndRebuild, including case, normalization, and combined aliases
  • FailedCoordinatedBuildReportsNewestOutputTailByTimestamp
  • FailedBuildForExplicitStartProjectReportsToAppHostLogWithoutDependentWait
  • BuildRestartedByEarlierStoppedHandlerReportsOnlyTheNewAttemptFailure
  • Real DCP failure reporting without live log subscribers
  • File-app rebuilds using original, case-variant, normalization-variant, and symlink paths

Evidence: latest-coordinator-tests.log, latest-coordinator-results/*.trx, latest-local-regression-summary.json.

2. Shared path-normalizer regression suite

Objective: verify the shared helper still handles symlinks, missing paths, filesystem identity, Unicode normalization, and combined case/normalization aliases.

dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj \
  --no-launch-profile -- \
  --filter-class '*.PathNormalizerTests' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true' \
  --report-trx --results-directory "$EVIDENCE/latest-path-normalizer-results"

Status: passed; exit code 0, 13 passed, 4 expected platform/filesystem skips.

ResolveToFilesystemPath_ResolvesCombinedCaseAndNormalizationAlias executed and passed. The skips cover Windows-only behavior or filesystem distinctions that cannot be represented on this local filesystem.

Evidence: latest-path-normalizer-tests.log, latest-path-normalizer-results/*.trx.

3. Supplementary diagnostic boundary and shutdown tests

Objective: verify the exact limits and failure behavior, rather than only testing that some output is present.

Four temporary test cases were added only in the isolated checkout, run against the unchanged latest-head product source, then removed. Their patch is retained as evidence.

dotnet test --project tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj \
  --no-launch-profile -- \
  --filter-method '*.BuildFailureDiagnosticsRespectOutputLimits' \
  --filter-method '*.BuildFailureDiagnosticReadsAreBoundedByTimeoutOrShutdown' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true' \
  --report-trx --results-directory "$EVIDENCE/latest-supplementary-results"

Status: passed; exit code 0, 4 passed, 0 failed, 0 skipped.

Verified exactly 20 reported lines, 1,000 characters per line, timestamp-stripped duplicate error suppression, output-tail fallback, preservation of partial diagnostics after the 10-second read timeout, and cancellation on application shutdown. The timeout case completed in approximately 10.07 seconds.

Evidence: latest-supplementary-tests.log, latest-supplementary-results/*.trx, latest-supplementary-diagnostics-tests.diff.

4. Real Blazor WebAssembly build through case-variant paths

Objective: exercise the actual dogfood hosting package and DCP with a fresh Blazor WebAssembly application, including the static-framework asset materialization affected by the original bug.

A fresh AppHost was created from the PR CLI/hive:

"$CLI" new aspire-empty --name CaseSmokeLatest \
  --output "$PR_TEST_ROOT/scenarios/CaseSmokeLatest" \
  --language csharp --source "$HIVE" --version 17.0.0-pr.21623.gfbe4088e \
  --localhost-tld false --suppress-agent-init --use-config-source false --non-interactive

dotnet new blazor --name HostedCase \
  --output "$PR_TEST_ROOT/scenarios/CaseSmokeLatest/HostedCase" \
  --interactivity WebAssembly --no-restore --no-https --exclude-launch-settings

Creation results: both commands succeeded.

The AppHost deliberately used cASEsMOKElATEST as its project-directory spelling and registered one project through hOSTEDcASE/hOSTEDcASE/hOSTEDcASE.CSPROJ. A second resource registered the same project with its normal spelling.

From that scenario directory:

"$CLI" start --non-interactive --isolated --apphost apphost.cs --format Json
"$CLI" wait gateway --apphost apphost.cs --status healthy --timeout 120 --non-interactive
"$CLI" wait gateway-copy --apphost apphost.cs --status healthy --timeout 120 --non-interactive
"$CLI" describe --apphost apphost.cs --include-hidden --format Json --non-interactive
"$CLI" logs __dotnet-project-build --apphost apphost.cs --format Json --non-interactive
python3 "$EVIDENCE/verify-case-smoke.py"

Status: passed; all final commands exited 0.

Verified:

  • Both resources were Running and Healthy.
  • Both launch paths and working directories used the on-disk HostedCase spelling.
  • The generated traversal contained exactly one ProjectFile entry for the two aliases.
  • Build output contained Build succeeded.
  • The materialized client PDB existed under obj/Debug/net11.0/fx/HostedCase.Client/_framework/.
  • The home page and the fingerprinted Blazor script advertised by that page returned HTTP 200; the script response contained 245,494 bytes.

Fixture correction: disabling launch profiles initially left the generated Blazor service in Production, where development-only static assets returned HTTP 500. Only the temporary fixture was corrected to restore ASPNETCORE_ENVIRONMENT=Development, as a normal Blazor launch profile would. The full HTTP/static-asset check then passed; no product code was changed.

Evidence: case-smoke-apphost.cs, verify-case-smoke.py, latest-case-smoke-summary.json, latest-case-smoke-traversal.proj, latest-case-smoke-build-logs.json, latest-case-smoke-wait.log.

5. Real compiler failure, repeated failure, and recovery

Objective: verify diagnostics reach the AppHost once per failed attempt, both dependent resources fail safely, and cached diagnostics do not prevent later recovery.

A separate fresh PR AppHost and ASP.NET worker were created. Two resources referenced the same worker project. Dashboard and resource-log forwarding were disabled; no live build-output subscription was opened before inspecting the diagnostic result.

"$CLI" start --non-interactive --isolated --apphost apphost.cs --format Json
"$CLI" wait worker-a --apphost apphost.cs --status up --timeout 60 --non-interactive
"$CLI" describe --apphost apphost.cs --include-hidden --format Json --non-interactive

Expected unhappy-path result: an injected undefined symbol must prevent startup and produce a nonzero wait result with useful compiler diagnostics.

Observed: wait returned exit code 18 and reported FailedToStart. Both worker-a and worker-b were FailedToStart. The AppHost log contained error CS0103 and the marker Pr21623AttemptOne, with exactly one coordinator failure record.

The source was changed to a different undefined symbol, then the existing build resource was started again:

"$CLI" resource __dotnet-project-build start --apphost apphost.cs --include-hidden --non-interactive
"$CLI" wait __dotnet-project-build --apphost apphost.cs --status down --timeout 90 --non-interactive

Observed: a fresh diagnostic containing Pr21623AttemptTwo; exactly two total coordinator failure records after two failed attempts.

Finally the compiler error was fixed, without restarting the AppHost:

"$CLI" resource __dotnet-project-build start --apphost apphost.cs --include-hidden --non-interactive
"$CLI" wait __dotnet-project-build --apphost apphost.cs --status down --timeout 90 --non-interactive
"$CLI" resource worker-a start --apphost apphost.cs --non-interactive
"$CLI" resource worker-b start --apphost apphost.cs --non-interactive
"$CLI" wait worker-a --apphost apphost.cs --status healthy --timeout 120 --non-interactive
"$CLI" wait worker-b --apphost apphost.cs --status healthy --timeout 120 --non-interactive

Status: passed. Both workers became healthy and returned HTTP 200 with the exact body Pr21623Recovered. The coordinator failure-record count remained two, with no stale failure on the successful attempt.

Evidence: failure-smoke-apphost.cs, latest-failure-smoke-attempt1-summary.json, latest-failure-smoke-attempt2-summary.json, latest-failure-smoke-recovery-summary.json, latest-failure-smoke-apphost-recovered.log, latest-failure-smoke-recovery.log.

6. Real explicit-start resource with no dependent waiter

Objective: verify the review fix reports a failed coordinated build even when the only project uses WithExplicitStart() and nobody waits for it to launch.

A third fresh PR AppHost used an intentionally broken worker marked WithExplicitStart(). Dashboard and resource-log forwarding were disabled.

"$CLI" start --non-interactive --isolated --apphost apphost.cs --format Json
"$CLI" wait __dotnet-project-build --apphost apphost.cs --status down --timeout 90 --non-interactive
"$CLI" describe --apphost apphost.cs --include-hidden --format Json --non-interactive

Status: passed; commands exited 0. The worker remained NotStarted, the coordinated build finished unsuccessfully, and the AppHost emitted exactly one coordinator failure record containing CS0103 and Pr21623ExplicitStartError. No dependent-start or dependent-wait operation was invoked.

Evidence: explicit-smoke-apphost.cs, latest-explicit-smoke-summary.json, latest-explicit-smoke-apphost.log.

7. Latest-head Windows validation

Objective: verify the original Windows scenario using actual test results, not just green job conclusions.

Windows hosting: job 125659666775, artifact logs-Hosting.Dotnet-windows-latest.

  • Parsed the downloaded TRX: 471 passed, 7 skipped, 0 failed.
  • Coordinator subset: 148 passed, 7 skipped, 0 failed.
  • CoordinatedBuildPathsUseOnDiskCasing, chronological output-tail reporting, explicit-start diagnostics, and stopped-event/restart handling all executed and passed.

Windows browser debugger: job 125659705076, artifact extension-e2e-diagnostics-win-x64-browser-debugger-attempt1.

  • Parsed the actual mocha.json: 8 passed, 0 failures, 0 pending.
  • Managed breakpoints were hit for standalone, hosted-global, and hosted-per-page Blazor scenarios.
  • Missing/outdated C# debugger extension error cases also passed.

Status: passed. These results belong to the latest-head CI run, not the pre-pause run.

Evidence: latest-windows-hosting.trx, latest-windows-hosting-results-summary.json, latest-windows-browser-mocha.json, latest-windows-browser-results-summary.json, latest-relevant-jobs.json.

Baseline Comparison for the Two Local Failures

Both failing cases are:

TraversalRestoreUsesProjectNuGetConfigAndHandlesColdPackagesChangedImportsAndLockedMode
    restoreProjectsIndividually: true
    restoreProjectsIndividually: false

Both fail with:

Could not find file '.../projects/packages/aspire.restoretest/1.0.0/Aspire.RestoreTest.nuspec'.

Before the pause, these exact two cases were run using the same pinned SDK on the pre-PR baseline 09065bbaa8ea63ae728b78cb5f4e8a73b6fe8c87:

dotnet test --project tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj \
  --no-launch-profile -- \
  --filter-method '*.TraversalRestoreUsesProjectNuGetConfigAndHandlesColdPackagesChangedImportsAndLockedMode' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true' \
  --report-trx --results-directory "$EVIDENCE/baseline-results"

Baseline result: exit code 2, both cases failed with the same missing-nuspec error. The latest PR suite reproduces those same failures. Their underlying local cause was not investigated further because the behavior predates this PR; they are not reported as new regressions.

Evidence: baseline-tests.log, baseline-results/*.trx, latest-coordinator-tests.log.

Summary

Scenario Result Notes
Source, CLI, and package identity Passed Latest head and containing CI merge verified
Local coordinator suite 153 passed, 2 failed Both failures reproduce on pre-PR baseline
Local path-normalizer suite 13 passed, 4 skipped Combined case/normalization alias executed and passed
Supplementary boundaries 4 passed Exact caps, deduplication, timeout, shutdown
Real case-variant Blazor build Passed One traversal entry, two healthy resources, materialized PDB and HTTP assets
Real failure/retry/recovery Passed One log record per failed attempt; both dependents recover in place
Real explicit-start failure Passed Diagnostic emitted with no dependent waiter
Windows hosting 471 passed, 7 skipped Includes 148 passing coordinator cases
Windows browser debugger 8 passed Actual Mocha results, including the original hosted-per-page scenario

Environment and Cleanup

  • All new AppHosts were created with the latest PR CLI in a temporary directory, using the downloaded PR hive and explicit package version.
  • Generated-app commands were configured to use the PR hive, https://packagefeedproxy.microsoft.io/nuget/v3/index.json, and approved dnceng feeds. Source tests used the repository's existing approved feed configuration. No vanilla NuGet feed was required.
  • No npm or PyPI dependencies were required. No containers were needed; Podman was selected as the container runtime for AppHost commands.
  • A machine-proposed configuration source was explicitly declined with --use-config-source false; the tests used standard generated Aspire configuration.
  • No repository NuGet.config, global.json, package manifests, or product files were modified.
  • All three test AppHosts were stopped using their exact paths. The isolated SDK build servers were shut down, and no test AppHosts remained in aspire ps.
  • The temporary source and baseline worktrees, CLI installation, generated applications, and downloaded diagnostic workspaces were removed.
  • Session evidence is retained. Resource environment credentials were omitted from retained snapshots and dashboard login tokens were redacted.
  • No product changes were committed or pushed.

Overall Result

PR-specific behavior verified on fbe4088ea48139044e9963197d2f024d42aefd6b; no new PR-specific failure found.

The two unchanged local cold-restore failures remain a separate caveat. This was targeted validation, not a full-repository test run; Windows execution was validated from the latest CI artifacts rather than a local Windows host.

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) merged commit d70dbf5 into main Nov 3, 2026
701 of 706 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 3, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → bug_fix_restores_documented_behavior. No signals triggered (signal_count 0). The PR normalizes path casing passed to MSBuild in the coordinated .NET build, fixing intermittent Blazor WebAssembly build failures on Windows. It adds no new public surface, options, or strings, so no docs change is needed.

Ella Hathaway (ellahathaway) pushed a commit that referenced this pull request Nov 9, 2026
)

## Description

**What failed:** On `main`, the Windows VS Code extension E2E jobs in
[run
41503655043](https://github.com/microsoft/aspire/actions/runs/41503655043)
failed: the
[browser-debugger](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
job's Blazor "maps managed Edge debugging" before-all hook timed out
waiting for `standalone` to reach Running, and the
[apphost-tree](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102839)
job hit the tree-actions "secondary AppHost" probe flake. The extension
log shows `E2E CLI path is invalid` followed by `Configured CLI path is
invalid`, about 1.2s after the CLI's first log write, which itself
arrived about 5s after launch.

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | Blazor `"before all" hook for "maps managed Edge
debugging…"` timing out on `standalone` Running **and** the first
`aspire-vscode.debugAppHost` invocation `canceled` (the CLI was
rejected). The `E2E CLI path is invalid` line is only in the
extension-log artifact, not the job log, so the canceled launch is used
as a proxy |
| Job | VS Code extension E2E (Windows, browser-debugger) |
| main pushes: hits / runs | 1 / 153 (0.65%) |
| main pushes, 30d: hits / runs | 1 / 265 (0.38%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 0 / 788 (0.00%); 0 PR-caused excluded |
| Combined rate | 1 / 941 = **0.11%** |
| Flake check | main: next main run of the job passed 1/1 |
| First / last hit | 2026-11-02 / 2026-11-02 |
| Still hitting main? | Last main hit: 2026-11-02. 78 main runs since
the last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: a new real-process test (6s startup stall) fails
before and passes after (single runs). This PR's CI: browser-debugger
(Windows) passed 1/1. |

Failing attempt-1 jobs, most recent first (1 of 1 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:46](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
| **main** | VS Code extension E2E (Windows, browser-debugger) | `Timed
out after 570124ms waiting for resource 'standalone' state Running` |

**Verdict: WEAK.** Only **1 hit** (main, 2026-11-02), matched through a
proxy signature. 78 main runs since then were clean. The other 11
before-all timeouts in this window are different: 8 are the `c:\` casing
bug fixed by #21623 and 3 show a successful launch.

<!-- /failure-stats -->

**Why:** `tryExecuteCli` (`extension/src/utils/cliPath.ts`) validates a
CLI by running `aspire --version` with a hard-coded **5s** timeout. When
a runner stall delays a valid CLI's startup past 5s, the probe rejects
it as invalid and the extension falls back or fails.
`configInfoProvider` already gives the same `aspire --version` command a
30s budget.

**Fix:** Move the named `cliVersionProbeTimeoutMs = 30_000` into
`cliPath.ts`, use it in `tryExecuteCli`, and import it in
`configInfoProvider` so both `--version` probes share one budget. A
probe still has to complete successfully. It does not accept a CLI that
hangs or exits with a non-zero code.

Of the 11 attempt-1 failures of the Blazor before-all hook in the last 7
days, 8 were the `c:\` casing issue that #21623 already fixed, 1 was a
DCP infrastructure timeout and 1 was on a spike branch. The remaining
hit is the one this PR fixes.

## Confidence

- New test `tryExecuteCli accepts a real CLI whose --version output is
delayed by a startup stall` launches a real script that sleeps 6s before
printing a version. On a POSIX runner it uses a `sh` script, and on
Windows a `.cmd` script.
  - **Before** (fix reverted, test kept): fails with `false !== true`.
  - **After**: passes (about 6.0s).
- The existing cmd-shim probe test now asserts the shared constant.
- `tsc` (`compile-tests`) and `eslint` pass on the changed files.
- **Not run:** the full `vscode-test` (Electron) suite and the E2E
suites. The sandbox can't resolve `update.code.visualstudio.com`.
Instead, I ran the compiled `cliPath` and `configInfoProvider` mocha
suites with a stubbed `vscode` module. With the stub, 25 tests that need
real VS Code workspace APIs fail on both unmodified `main` and this
branch, and the failing set is identical. CI covers the rest.

**How we stop this recurring:** Both `aspire --version` probes now share
one named budget, so they can't drift apart again. The real-process test
fails if the probe budget is cut back below a realistic startup stall.

Refs #21600

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
)

## Description

**What failed:** On `main`, the Windows VS Code extension E2E jobs in
[run
41503655043](https://github.com/microsoft/aspire/actions/runs/41503655043)
failed: the
[browser-debugger](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
job's Blazor "maps managed Edge debugging" before-all hook timed out
waiting for `standalone` to reach Running, and the
[apphost-tree](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102839)
job hit the tree-actions "secondary AppHost" probe flake. The extension
log shows `E2E CLI path is invalid` followed by `Configured CLI path is
invalid`, about 1.2s after the CLI's first log write, which itself
arrived about 5s after launch.

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | Blazor `"before all" hook for "maps managed Edge
debugging…"` timing out on `standalone` Running **and** the first
`aspire-vscode.debugAppHost` invocation `canceled` (the CLI was
rejected). The `E2E CLI path is invalid` line is only in the
extension-log artifact, not the job log, so the canceled launch is used
as a proxy |
| Job | VS Code extension E2E (Windows, browser-debugger) |
| main pushes: hits / runs | 1 / 153 (0.65%) |
| main pushes, 30d: hits / runs | 1 / 265 (0.38%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 0 / 788 (0.00%); 0 PR-caused excluded |
| Combined rate | 1 / 941 = **0.11%** |
| Flake check | main: next main run of the job passed 1/1 |
| First / last hit | 2026-11-02 / 2026-11-02 |
| Still hitting main? | Last main hit: 2026-11-02. 78 main runs since
the last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: a new real-process test (6s startup stall) fails
before and passes after (single runs). This PR's CI: browser-debugger
(Windows) passed 1/1. |

Failing attempt-1 jobs, most recent first (1 of 1 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:46](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
| **main** | VS Code extension E2E (Windows, browser-debugger) | `Timed
out after 570124ms waiting for resource 'standalone' state Running` |

**Verdict: WEAK.** Only **1 hit** (main, 2026-11-02), matched through a
proxy signature. 78 main runs since then were clean. The other 11
before-all timeouts in this window are different: 8 are the `c:\` casing
bug fixed by #21623 and 3 show a successful launch.

<!-- /failure-stats -->

**Why:** `tryExecuteCli` (`extension/src/utils/cliPath.ts`) validates a
CLI by running `aspire --version` with a hard-coded **5s** timeout. When
a runner stall delays a valid CLI's startup past 5s, the probe rejects
it as invalid and the extension falls back or fails.
`configInfoProvider` already gives the same `aspire --version` command a
30s budget.

**Fix:** Move the named `cliVersionProbeTimeoutMs = 30_000` into
`cliPath.ts`, use it in `tryExecuteCli`, and import it in
`configInfoProvider` so both `--version` probes share one budget. A
probe still has to complete successfully. It does not accept a CLI that
hangs or exits with a non-zero code.

Of the 11 attempt-1 failures of the Blazor before-all hook in the last 7
days, 8 were the `c:\` casing issue that #21623 already fixed, 1 was a
DCP infrastructure timeout and 1 was on a spike branch. The remaining
hit is the one this PR fixes.

## Confidence

- New test `tryExecuteCli accepts a real CLI whose --version output is
delayed by a startup stall` launches a real script that sleeps 6s before
printing a version. On a POSIX runner it uses a `sh` script, and on
Windows a `.cmd` script.
  - **Before** (fix reverted, test kept): fails with `false !== true`.
  - **After**: passes (about 6.0s).
- The existing cmd-shim probe test now asserts the shared constant.
- `tsc` (`compile-tests`) and `eslint` pass on the changed files.
- **Not run:** the full `vscode-test` (Electron) suite and the E2E
suites. The sandbox can't resolve `update.code.visualstudio.com`.
Instead, I ran the compiled `cliPath` and `configInfoProvider` mocha
suites with a stubbed `vscode` module. With the stub, 25 tests that need
real VS Code workspace APIs fail on both unmodified `main` and this
branch, and the failing set is identical. CI covers the rest.

**How we stop this recurring:** Both `aspire --version` probes now share
one named budget, so they can't drift apart again. The real-process test
fails if the probe budget is cut back below a realistic startup stall.

Refs #21600

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit cd3fec7)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
)

## Description

**What failed:** On `main`, the Windows VS Code extension E2E jobs in
[run
41503655043](https://github.com/microsoft/aspire/actions/runs/41503655043)
failed: the
[browser-debugger](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
job's Blazor "maps managed Edge debugging" before-all hook timed out
waiting for `standalone` to reach Running, and the
[apphost-tree](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102839)
job hit the tree-actions "secondary AppHost" probe flake. The extension
log shows `E2E CLI path is invalid` followed by `Configured CLI path is
invalid`, about 1.2s after the CLI's first log write, which itself
arrived about 5s after launch.

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | Blazor `"before all" hook for "maps managed Edge
debugging…"` timing out on `standalone` Running **and** the first
`aspire-vscode.debugAppHost` invocation `canceled` (the CLI was
rejected). The `E2E CLI path is invalid` line is only in the
extension-log artifact, not the job log, so the canceled launch is used
as a proxy |
| Job | VS Code extension E2E (Windows, browser-debugger) |
| main pushes: hits / runs | 1 / 153 (0.65%) |
| main pushes, 30d: hits / runs | 1 / 265 (0.38%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 0 / 788 (0.00%); 0 PR-caused excluded |
| Combined rate | 1 / 941 = **0.11%** |
| Flake check | main: next main run of the job passed 1/1 |
| First / last hit | 2026-11-02 / 2026-11-02 |
| Still hitting main? | Last main hit: 2026-11-02. 78 main runs since
the last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: a new real-process test (6s startup stall) fails
before and passes after (single runs). This PR's CI: browser-debugger
(Windows) passed 1/1. |

Failing attempt-1 jobs, most recent first (1 of 1 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:46](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
| **main** | VS Code extension E2E (Windows, browser-debugger) | `Timed
out after 570124ms waiting for resource 'standalone' state Running` |

**Verdict: WEAK.** Only **1 hit** (main, 2026-11-02), matched through a
proxy signature. 78 main runs since then were clean. The other 11
before-all timeouts in this window are different: 8 are the `c:\` casing
bug fixed by #21623 and 3 show a successful launch.

<!-- /failure-stats -->

**Why:** `tryExecuteCli` (`extension/src/utils/cliPath.ts`) validates a
CLI by running `aspire --version` with a hard-coded **5s** timeout. When
a runner stall delays a valid CLI's startup past 5s, the probe rejects
it as invalid and the extension falls back or fails.
`configInfoProvider` already gives the same `aspire --version` command a
30s budget.

**Fix:** Move the named `cliVersionProbeTimeoutMs = 30_000` into
`cliPath.ts`, use it in `tryExecuteCli`, and import it in
`configInfoProvider` so both `--version` probes share one budget. A
probe still has to complete successfully. It does not accept a CLI that
hangs or exits with a non-zero code.

Of the 11 attempt-1 failures of the Blazor before-all hook in the last 7
days, 8 were the `c:\` casing issue that #21623 already fixed, 1 was a
DCP infrastructure timeout and 1 was on a spike branch. The remaining
hit is the one this PR fixes.

## Confidence

- New test `tryExecuteCli accepts a real CLI whose --version output is
delayed by a startup stall` launches a real script that sleeps 6s before
printing a version. On a POSIX runner it uses a `sh` script, and on
Windows a `.cmd` script.
  - **Before** (fix reverted, test kept): fails with `false !== true`.
  - **After**: passes (about 6.0s).
- The existing cmd-shim probe test now asserts the shared constant.
- `tsc` (`compile-tests`) and `eslint` pass on the changed files.
- **Not run:** the full `vscode-test` (Electron) suite and the E2E
suites. The sandbox can't resolve `update.code.visualstudio.com`.
Instead, I ran the compiled `cliPath` and `configInfoProvider` mocha
suites with a stubbed `vscode` module. With the stub, 25 tests that need
real VS Code workspace APIs fail on both unmodified `main` and this
branch, and the failing set is identical. CI covers the rest.

**How we stop this recurring:** Both `aspire --version` probes now share
one named budget, so they can't drift apart again. The real-process test
fails if the probe budget is cut back below a realistic startup stall.

Refs #21600

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit cd3fec7)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
)

## Description

**What failed:** On `main`, the Windows VS Code extension E2E jobs in
[run
41503655043](https://github.com/microsoft/aspire/actions/runs/41503655043)
failed: the
[browser-debugger](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
job's Blazor "maps managed Edge debugging" before-all hook timed out
waiting for `standalone` to reach Running, and the
[apphost-tree](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102839)
job hit the tree-actions "secondary AppHost" probe flake. The extension
log shows `E2E CLI path is invalid` followed by `Configured CLI path is
invalid`, about 1.2s after the CLI's first log write, which itself
arrived about 5s after launch.

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | Blazor `"before all" hook for "maps managed Edge
debugging…"` timing out on `standalone` Running **and** the first
`aspire-vscode.debugAppHost` invocation `canceled` (the CLI was
rejected). The `E2E CLI path is invalid` line is only in the
extension-log artifact, not the job log, so the canceled launch is used
as a proxy |
| Job | VS Code extension E2E (Windows, browser-debugger) |
| main pushes: hits / runs | 1 / 153 (0.65%) |
| main pushes, 30d: hits / runs | 1 / 265 (0.38%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 0 / 788 (0.00%); 0 PR-caused excluded |
| Combined rate | 1 / 941 = **0.11%** |
| Flake check | main: next main run of the job passed 1/1 |
| First / last hit | 2026-11-02 / 2026-11-02 |
| Still hitting main? | Last main hit: 2026-11-02. 78 main runs since
the last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: a new real-process test (6s startup stall) fails
before and passes after (single runs). This PR's CI: browser-debugger
(Windows) passed 1/1. |

Failing attempt-1 jobs, most recent first (1 of 1 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:46](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
| **main** | VS Code extension E2E (Windows, browser-debugger) | `Timed
out after 570124ms waiting for resource 'standalone' state Running` |

**Verdict: WEAK.** Only **1 hit** (main, 2026-11-02), matched through a
proxy signature. 78 main runs since then were clean. The other 11
before-all timeouts in this window are different: 8 are the `c:\` casing
bug fixed by #21623 and 3 show a successful launch.

<!-- /failure-stats -->

**Why:** `tryExecuteCli` (`extension/src/utils/cliPath.ts`) validates a
CLI by running `aspire --version` with a hard-coded **5s** timeout. When
a runner stall delays a valid CLI's startup past 5s, the probe rejects
it as invalid and the extension falls back or fails.
`configInfoProvider` already gives the same `aspire --version` command a
30s budget.

**Fix:** Move the named `cliVersionProbeTimeoutMs = 30_000` into
`cliPath.ts`, use it in `tryExecuteCli`, and import it in
`configInfoProvider` so both `--version` probes share one budget. A
probe still has to complete successfully. It does not accept a CLI that
hangs or exits with a non-zero code.

Of the 11 attempt-1 failures of the Blazor before-all hook in the last 7
days, 8 were the `c:\` casing issue that #21623 already fixed, 1 was a
DCP infrastructure timeout and 1 was on a spike branch. The remaining
hit is the one this PR fixes.

## Confidence

- New test `tryExecuteCli accepts a real CLI whose --version output is
delayed by a startup stall` launches a real script that sleeps 6s before
printing a version. On a POSIX runner it uses a `sh` script, and on
Windows a `.cmd` script.
  - **Before** (fix reverted, test kept): fails with `false !== true`.
  - **After**: passes (about 6.0s).
- The existing cmd-shim probe test now asserts the shared constant.
- `tsc` (`compile-tests`) and `eslint` pass on the changed files.
- **Not run:** the full `vscode-test` (Electron) suite and the E2E
suites. The sandbox can't resolve `update.code.visualstudio.com`.
Instead, I ran the compiled `cliPath` and `configInfoProvider` mocha
suites with a stubbed `vscode` module. With the stub, 25 tests that need
real VS Code workspace APIs fail on both unmodified `main` and this
branch, and the failing set is identical. CI covers the rest.

**How we stop this recurring:** Both `aspire --version` probes now share
one named budget, so they can't drift apart again. The real-process test
fails if the probe budget is cut back below a realistic startup stall.

Refs #21600

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit cd3fec7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-health Fixes CI flakiness or CI infrastructure (AspireAgent queue) needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI Failure] Flaky: VS Code browser-debugger E2E (Windows) - standalone-gateway FailedToStart after coordinated build

3 participants