Skip to content

Ensure Aspire CLI bundle resolution - #19251

Merged
Karol Zadora-Przylecki (karolz-ms) merged 8 commits into
mainfrom
dev/karolz/ensure-bundle-availability
Aug 13, 2026
Merged

Ensure Aspire CLI bundle resolution#19251
Karol Zadora-Przylecki (karolz-ms) merged 8 commits into
mainfrom
dev/karolz/ensure-bundle-availability

Conversation

@karolz-ms

Copy link
Copy Markdown
Contributor

Description

Fresh Aspire CLI installations can have a valid embedded bundle that has not been extracted yet. When an AppHost uses AspireUseCliBundle=true, that previously allowed the build to complete without DCP or dashboard metadata, causing direct or IDE launches to fail before the first successful CLI run.

This change ensures the bundle is available across installation and launch paths:

  • AppHost targets resolve an existing layout, run aspire setup through the selected PATH or paired DNX CLI only when needed, then resolve the layout again.
  • Release installers eagerly run setup after writing the install sidecar.
  • CLI project inspection carries build-resolved DCP and dashboard paths into direct launches and rejects launches that still lack usable paths.
  • Bundle-aware cache entries are invalidated when their runtime files no longer exist.
  • Setup failures produce actionable diagnostics instead of a metadata-free AppHost.

User-facing behavior

After installing the Aspire CLI, users can build and launch an AspireUseCliBundle=true AppHost directly from an IDE without first running an Aspire CLI command. Installations that did not use the release scripts are recovered by the build targets on demand.

Validation included:

  • PowerShell and shell installer coverage, including setup ordering and failure propagation.
  • Hosting target coverage for PATH and DNX setup, invalid explicit paths, and missing layouts.
  • CLI resolver, cache, environment precedence, and pre-launch guard coverage.
  • Installation of the exact staging CLI 13.5.0+cfbf1c432e94dfe4a3261593eeef8c93913079bb through both updated scripts.
  • A direct launch of the original minimal AppHost with ASPIRE_DCP_PATH and ASPIRE_DASHBOARD_PATH removed, reaching a healthy dashboard.

Fixes #19227

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
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Copilot AI balanced review requested due to automatic review settings August 11, 2026 21:35
@github-actions

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 -- 19251

Or

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

@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.

Pull request overview

Ensures CLI bundle dependencies are prepared and propagated for direct AppHost builds and launches.

Changes:

  • Runs bundle setup from installers and MSBuild when required.
  • Carries validated DCP/dashboard paths through CLI inspection and caching.
  • Adds regression coverage and localized diagnostics.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Aspire.Hosting.Tests/MSBuildTests.cs Tests bundle preparation and failure diagnostics.
tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs Tests PATH/DNX setup behavior.
tests/Aspire.Hosting.Sdk.Tests.FakeCommand/Program.cs Simulates bundle setup.
tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs Tests runtime-path precedence and validation.
tests/Aspire.Cli.Tests/Projects/AppHostInfoResolverTests.cs Tests discovery metadata retrieval.
tests/Aspire.Cli.Tests/Caching/AppHostInfoDiskCacheTests.cs Tests missing bundle-file invalidation.
tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptShellTests.cs Verifies shell installer setup ordering.
tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptPSFunctionTests.cs Tests PowerShell setup failure propagation.
tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptPowerShellTests.cs Verifies PowerShell installer setup ordering.
tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptFunctionTests.cs Tests shell setup failure propagation.
src/Aspire.Hosting.Tasks/ResolveAspireCliBundle.cs Exposes the resolved Aspire home.
src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Adds on-demand bundle setup and diagnostics.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hant.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hans.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.tr.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ru.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.pt-BR.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.pl.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ko.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ja.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.it.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.fr.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.es.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.de.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.cs.xlf Adds localized-resource entry.
src/Aspire.Cli/Resources/RunCommandStrings.resx Adds missing-path diagnostic.
src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs Exposes the new resource.
src/Aspire.Cli/Projects/DotNetAppHostProject.cs Validates and injects resolved runtime paths.
src/Aspire.Cli/Projects/AppHostInfoResolver.cs Captures build-resolved bundle metadata.
src/Aspire.Cli/Caching/AppHostInfoDiskCache.cs Caches and validates bundle paths.
eng/scripts/get-aspire-cli.sh Runs setup after shell installation.
eng/scripts/get-aspire-cli.ps1 Runs setup after PowerShell installation.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Generated file

Comment thread src/Aspire.Cli/Caching/AppHostInfoDiskCache.cs Outdated
@github-actions

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

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

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

Karol Zadora-Przylecki (karolz-ms) commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

PR Testing Report

PR Information

Artifact Version Verification

  • Expected commit: 621c585099776d9076617baa7f32a7db5ce4db5a
  • Windows PR CLI: 13.6.0-pr.19251.g621c5850
  • Linux PR CLI: 13.6.0-pr.19251.g621c5850
  • Source checkout: exact PR head, clean after testing
  • Status: Verified

Changes Analyzed

  • eng/scripts/get-aspire-cli.ps1 and eng/scripts/get-aspire-cli.sh: eagerly run aspire setup and propagate setup failures.
  • src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets and src/Aspire.Hosting.Tasks/ResolveAspireCliBundle.cs: prepare missing bundle layouts through PATH/DNX and emit ASPIRE009 when no usable layout is produced.
  • src/Aspire.Cli/Projects/AppHostInfoResolver.cs, DotNetAppHostProject.cs, and Caching/AppHostInfoDiskCache.cs: carry build-resolved runtime paths into launches and invalidate stale bundle cache entries.
  • Focused acquisition, CLI, Hosting SDK, and MSBuild tests were added or updated.

Change Categories

  • CLI
  • Hosting/MSBuild
  • Acquisition scripts
  • Tests
  • Dashboard source
  • Templates
  • VS Code extension
  • CI infrastructure

Test Scenarios Executed

1. Focused source tests

Objective: Validate the changed acquisition, resolver/cache/project, SDK-target, and MSBuild behavior from the exact PR source.

Status: PASSED

Test area Passed Skipped Failed
Acquisition script classes 67 0 0
CLI cache/resolver/project classes 159 0 0
Hosting SDK targets 40 1 Windows-only platform skip 0
Hosting MSBuild bundle tests 3 0 0
Total 269 1 0

Evidence: evidence/source-tests-*.log

2. Windows and Linux PR artifact installation

Objective: Install the actual PR CLI artifacts in isolated locations and verify that each matches the PR head.

Status: PASSED

  • Windows: 13.6.0-pr.19251.g621c5850
  • Linux container: 13.6.0-pr.19251.g621c5850

Evidence: evidence/windows-install.log, evidence/windows-version.txt, evidence/linux-install.log, evidence/linux-version.txt

3. Changed release installer scripts

Objective: Exercise the PowerShell and shell release installer implementations from the PR source, including eager bundle setup.

Status: PASSED

  • PowerShell installed staging CLI 13.5.0+1d922813c0f9bc14f7d817c817a8ab46b288bb44 under a fresh prefix.
  • PowerShell setup created bundle, versions, dcp, and managed.
  • The shell installer at the PR commit installed the same staging CLI in the Linux container.
  • Shell setup reported Bundle extracted to /workspace and created versions/.../dcp and versions/.../managed.

Evidence: evidence/windows-release-installer-fresh.log, evidence/windows-release-fresh-bundle-paths.txt, evidence/linux-release-installer.log, evidence/linux-release-bundle-paths.txt

4. Direct AppHost launch with no existing bundle layout

Objective: Reproduce the original IDE/direct-launch path with AspireUseCliBundle=true, no DCP/dashboard environment overrides, and no previously extracted dogfood layout.

Status: PASSED

  1. Created an Aspire Empty App from the exact PR template package without invoking Aspire CLI.
  2. Restored the AppHost from the PR hive and verified 13.6.0-pr.19251.g621c5850 in project.assets.json.
  3. Confirmed the dogfood versions layout did not exist.
  4. Ran the AppHost directly with dotnet run.
  5. Confirmed the build created versions/.../dcp and versions/.../managed.
  6. Confirmed the dashboard login redirected to / and returned HTTP 200.

Evidence: evidence/direct-launch-restore.log, evidence/direct-launch-run.log, evidence/direct-launch-dashboard.txt

5. On-demand recovery after runtime deletion

Objective: Verify stale/missing runtime files are recoverable on a subsequent direct launch.

Status: PASSED

  1. Stopped the AppHost and confirmed the dashboard no longer responded.
  2. Deleted only the isolated dogfood bundle and versions directories.
  3. Confirmed both paths were absent.
  4. Repeated direct dotnet run.
  5. Confirmed the layout was recreated and the dashboard again returned HTTP 200.

Evidence: evidence/recovery-run.log, evidence/recovery-dashboard.txt

6. Invalid explicit CLI path

Objective: Ensure an invalid authoritative AspireCliPath is not masked by a valid CLI on PATH.

Coverage type: Unhappy path

Status: PASSED (expected failure)

  • Build exited with code 1.
  • The target warned that the explicit executable did not exist.
  • Build emitted ASPIRE009 with instructions to install Aspire CLI or configure a valid AspireCliBundlePath/AspireCliPath.

Evidence: evidence/invalid-cli-build.log

7. Fresh aspire start before AppHost restore

Objective: Validate the standard cold-cache flow: aspire new aspire-starter followed immediately by aspire start.

Status: FAILED - PR regression reproduced

  1. Created a fresh starter app using the exact PR CLI, template hive, and an isolated NuGet cache.
  2. Ran aspire start before restoring/building the generated AppHost.
  3. CLI exited with code 7 and reported that no buildable AppHost was found.
  4. The CLI diagnostic log shows:
error MSB4057: The target "SetOrchestrationDiscoveryAttributes" does not exist in the project.

AppHostInfoResolver now requests SetOrchestrationDiscoveryAttributes, SetDashboardDiscoveryAttributes, and ComputeRunArguments during pre-build inspection. The first target is supplied by Aspire.Hosting.AppHost.targets, which is not imported yet for a freshly generated, unrestored AppHost.

Evidence: evidence/cold-cache-new.log, evidence/cold-cache-start.log, evidence/cold-cache-cli-diagnostic.log

GitHub Actions Validation

At the final snapshot, the PR had:

  • 299 successful checks
  • 36 failed checks
  • 1 check still in progress
  • 3 skipped checks

The 36 failures share the same missing-target root cause: 34 CLI end-to-end jobs plus Windows x64 and ARM64 starter validation.

Representative failures:

Downloaded CI diagnostics are under ci-failures/.

Summary

Scenario Status Notes
Focused source tests PASSED 269 passed, 1 platform skip
Windows/Linux PR artifact verification PASSED Both match 621c5850
PowerShell/shell release installers PASSED Fresh bundle layouts extracted
Direct dotnet run without layout PASSED Layout recovered; dashboard HTTP 200
Repeated recovery after deletion PASSED Layout recreated; dashboard HTTP 200
Invalid explicit CLI path PASSED Expected actionable ASPIRE009
Fresh aspire start FAILED MSB4057 before first restore

Overall Result

ISSUES FOUND - PR NOT VERIFIED

The intended direct-launch and installer behavior works, but the new pre-build AppHost inspection breaks the standard fresh-project workflow before restore. The PR should not merge until AppHostInfoResolver avoids requesting package-defined targets before they are available, or ensures the project is restored before that probe. The cold-cache aspire new then aspire start path should remain covered by end-to-end validation.

Artifacts

  • Report: pr-19251-testing-report.md
  • Scenario evidence: evidence/
  • CI failure diagnostics: ci-failures/
  • Temporary root: C:\Users\karolz\AppData\Local\Temp\aspire-pr-19251-621c585-copilot

PR Comment and Cleanup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Found 2 correctness issues.

Comment thread src/Aspire.Cli/Projects/AppHostInfoResolver.cs Outdated
Comment thread src/Aspire.Cli/Caching/AppHostInfoDiskCache.cs Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code review of the CLI bundle resolution changes. 10 findings, all problems rather than style notes.

By category

  • Correctness / behavioral regression (3): unusable bundle-layout paths shadow the new build-resolved fallback and hard-fail the launch; the new launch guard ignores env vars, DcpPublisher config, and baked assembly metadata; publish/deploy is now blocked on a dashboard binary it never uses.
  • Diagnostics (1): MSBuild errors during project inspection are swallowed and reported as "not an AppHost".
  • Behavior change in a probe path (1): aspire run / aspire ls inspection can now execute aspire setup or a dnx download, with two 120s Exec timeouts.
  • Acquisition scripts (1): a transient bundle-setup failure aborts the whole install after the binary is written but before PATH configuration.
  • Test reliability (1): the Windows branch of the new DNX test does not exit — it consumes the 120s Exec timeout out of a 180s budget.
  • Build robustness (2): Exec launch failures surface as warnings that break -warnaserror consumers; the cmd shim caret-escaping omits %.
  • Test coverage (1): no coverage for the environment-provided-paths case, the publish guard, or the stale-layout regression that motivated this PR.

De-duplicated against feedback already on this PR — the cache-identity issue (raised twice on AppHostInfoDiskCache.cs), the MSB4057 missing-target problem on AppHostInfoResolver.cs:147, and the MSB4057 blocker in the PR testing comment are deliberately not repeated. My two comments in that same area are scoped to what survives a fix for it: the swallowed MSBuild diagnostics, and the Exec/dnx side effects that remain even for restored Aspire AppHosts.

Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Comment thread src/Aspire.Cli/Projects/AppHostInfoResolver.cs Outdated
Comment thread src/Aspire.Cli/Projects/AppHostInfoResolver.cs Outdated
Comment thread eng/scripts/get-aspire-cli.sh
Comment thread tests/Aspire.Hosting.Tests/MSBuildTests.cs Outdated
Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated
Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated
Comment thread tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs Outdated
Copilot AI review requested due to automatic review settings August 12, 2026 13:45
@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.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Generated file
Suppressed comments (3)

src/Aspire.Cli/Projects/DotNetAppHostProject.cs:2480

  • This only logs when an AspireUseCliBundle=true launch has no current CLI layout; RunAsync still proceeds without verifying that DCP and dashboard are available from overrides or the built AppHost metadata. In particular, --no-build can launch an older output whose stamped paths were deleted and reproduce the late OptionsValidationException this change is intended to replace. Carry the resolved paths through inspection and reject the launch with the actionable CLI diagnostic when neither source is usable.
                _logger.LogDebug("AspireUseCliBundle is enabled, but the Aspire CLI bundle layout was not available from this CLI process. The AppHost will resolve configured, inherited, or assembly-metadata paths.");

src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets:262

  • The percent escaping is only applied to .cmd/.bat shims, but MSBuild Exec writes a temporary batch file for this native-executable branch too. On Windows, a valid aspire.exe path containing a literal %NAME% segment is therefore environment-expanded and the setup command targets the wrong path. Escape % to %% for the Windows native path before constructing this command.
      <_AspireCliSetupCommand Condition="'$(AspireCliBundlePath)' == '' and Exists('$(_AspireCliSetupPath)') and '$(_AspireCliSetupPathIsWindowsCommandShim)' != 'true'">"$(_AspireCliSetupPath)" setup</_AspireCliSetupCommand>

tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs:930

  • The fake DNX handles setup --install-path only in the Unix script arm. On Windows, CreateFakeDnxAsync still just captures the arguments and exits successfully without creating bundle/dcp/dcp.exe or bundle/managed/aspire-managed.exe; the updated cross-platform test then re-resolves an empty layout and fails with ASPIRE009. Add the equivalent setup case to the Windows batch implementation.
                if [ "$1" = "--yes" ] && [ "$2" = "aspire.cli@13.5.0" ] && [ "$3" = "--" ] && [ "$4" = "setup" ] && [ "$5" = "--install-path" ]; then
                    mkdir -p "$6/bundle/dcp" "$6/bundle/managed"
                    : > "$6/bundle/dcp/dcp"
                    : > "$6/bundle/managed/aspire-managed"
                    exit 0

@github-actions

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

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

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) force-pushed the dev/karolz/ensure-bundle-availability branch from fc7f515 to 9e25792 Compare August 12, 2026 17:14
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the CLI bundle resolution changes end to end (MSBuild targets, CLI launch/publish paths, install scripts, and tests), taking the two earlier review rounds and the fixes in fc7f515f into account.

7 issues found:

  • Bugs / correctness (3): Exec timeout bypassing the ASPIRE009 diagnostic (verified empirically against MSBuild), empty environment variables treated as overrides in HasEnvironmentOverride, and a non-runnable command string embedded in the ASPIRE009 text.
  • Behavior consistency (2): unvalidated inherited runtime paths taking precedence over a validated layout, and the PowerShell installer throwing on unsupported host architectures where the shell installer degrades gracefully.
  • Cross-platform parity (1): bundle setup / VS Code extension install ordering differs between get-aspire-cli.ps1 and get-aspire-cli.sh.
  • Test coverage (1): the aspire setup fake extracts to ASPIRE_HOME rather than next to the CLI binary, so the CLI-adjacent re-resolution path from #19227 isn't actually covered.

Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated
Comment thread tests/Aspire.Hosting.Tests/MSBuildTests.cs Outdated
Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs
Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated
Comment thread eng/scripts/get-aspire-cli.ps1 Outdated
Comment thread eng/scripts/get-aspire-cli.ps1 Outdated
Copilot AI review requested due to automatic review settings August 12, 2026 23:02
@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.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Generated file
Suppressed comments (2)

tests/Aspire.Cli.Tests/Caching/AppHostInfoDiskCacheTests.cs:131

  • runCommand and runArguments are not project-only metadata for bundle AppHosts: ComputeRunArguments embeds the absolute Aspire/DNX command selected from PATH. ComputeKeyAsync does not fingerprint PATH (or other environment-provided MSBuild properties), so changing PATH between CLI invocations while the old CLI still exists returns this cache entry and direct launch runs the previously selected CLI. Include the invocation environment in the cache identity or stop persisting the Run* values, and add a regression that switches between two existing PATH CLIs.
                "runCommand",
                "runWorkingDirectory",

src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets:300

  • This recovery path still fails under -warnaserror when the PATH CLI times out. WarnAndContinue converts Exec's timeout error (MSB5002) into a warning, which warnings-as-errors promotes even if the subsequent DNX fallback creates a valid layout. Suppress/demote the expected timeout diagnostic when fallback can recover, and run the existing timeout-fallback test with warnings treated as errors.
          Timeout="$(_AspireCliBundleSetupTimeout)"
          ContinueOnError="WarnAndContinue">

Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Found 2 correctness issues in the bundle recovery target: invalid explicit-path diagnostics are suppressed, and a recovered timeout can still fail warnings-as-errors builds.

Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets
Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets Outdated
@github-actions

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

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

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 17:12
@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.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Generated file

Comment thread src/Aspire.Hosting.Tasks/RunAspireCliCommand.cs Outdated
@github-actions

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 18:17
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

52 / 100 test projects · 7 jobs, from 27 changed files.

Selected test projects (52 / 100)

Aspire.Acquisition.Tests, Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.EndToEnd.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.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.GitHub.Models.Tests, Aspire.Hosting.Go.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.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.Sdk.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

Selected jobs (7)

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


How these were chosen — grouped by what changed

⚠️ 41 of the 52 selected test projects come from a single change — src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets.

🔧 src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets (changed source)
41 via the project graph

show 41

Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.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.GitHub.Models.Tests, Aspire.Hosting.Go.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.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.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests

🔧 src/Aspire.Hosting/Dcp/DcpOptions.cs (changed source)
6 via the project graph: 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.RemoteHost.Tests

📄 eng/scripts/get-aspire-cli.ps1 (changed)
2 directly: Aspire.Acquisition.Tests, Aspire.Cli.EndToEnd.Tests

📄 eng/scripts/get-aspire-cli.sh (changed)
2 directly: Aspire.Acquisition.Tests, Aspire.Cli.EndToEnd.Tests

📦 affected project Aspire.Cli
1 test: Aspire.Cli.EndToEnd.Tests

📦 affected project Aspire.Hosting.AppHost
1 test: Aspire.EndToEnd.Tests

🔧 src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs (changed source)
1 via the project graph: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptFunctionTests.cs (changed test)
1 directly: Aspire.Acquisition.Tests

🧪 tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptPSFunctionTests.cs (changed test)
1 directly: Aspire.Acquisition.Tests

🧪 tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptPowerShellTests.cs (changed test)
1 directly: Aspire.Acquisition.Tests

🧪 tests/Aspire.Acquisition.Tests/Scripts/ReleaseScriptShellTests.cs (changed test)
1 directly: Aspire.Acquisition.Tests

🧪 tests/Aspire.Cli.Tests/BundleServiceIntegrationTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/BundleServiceTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Caching/AppHostInfoDiskCacheTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Layout/LayoutDiscoveryReparsePointTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/AppHostInfoResolverTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs (changed test)
1 directly: Aspire.Hosting.Sdk.Tests

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

🧪 tests/Aspire.Hosting.Tests/Dcp/DcpCliArgsTests.cs (changed test)
1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/MSBuildTests.cs (changed test)
1 directly: Aspire.Hosting.Tests

Job reasons

Job Triggered by
cli-starter eng/scripts/get-aspire-cli.ps1, eng/scripts/get-aspire-cli.sh
• affected project Aspire.Cli
• selected test Aspire.Cli.Tests
• selected test Aspire.Acquisition.Tests
deployment-e2e affected project Aspire.Cli
extension-e2e eng/scripts/get-aspire-cli.ps1, eng/scripts/get-aspire-cli.sh, src/Aspire.Cli/Bundles/BundleService.cs, src/Aspire.Cli/Layout/LayoutDiscovery.cs, src/Aspire.Cli/Projects/AppHostInfoResolver.cs, src/Aspire.Cli/Projects/DotNetAppHostProject.cs, src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs, src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets, src/Aspire.Hosting.Tasks/ResolveAspireCliBundle.cs, src/Aspire.Hosting.Tasks/ResolveAspireCliInvocation.cs, src/Aspire.Hosting.Tasks/RunAspireCliCommand.cs, src/Aspire.Hosting/Dcp/DcpOptions.cs, tests/Aspire.Cli.Tests/BundleServiceIntegrationTests.cs, tests/Aspire.Cli.Tests/BundleServiceTests.cs, tests/Aspire.Cli.Tests/Caching/AppHostInfoDiskCacheTests.cs, tests/Aspire.Cli.Tests/Layout/LayoutDiscoveryReparsePointTests.cs, tests/Aspire.Cli.Tests/Projects/AppHostInfoResolverTests.cs, tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs
• affected project Aspire.Cli
homebrew-installer selected test Aspire.Acquisition.Tests
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli
winget-installer selected test Aspire.Acquisition.Tests

Selection computed for commit 1fe0641.

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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Generated file
Suppressed comments (1)

src/Aspire.Cli/Projects/DotNetAppHostProject.cs:1515

  • The PR description still says project inspection carries build-resolved DCP/dashboard paths into direct launches, but this code now inspects only IsUsingCliBundle and resolves runtime paths from the current CLI layout; the new cache and run tests explicitly enforce that inspection paths are not persisted or injected. The earlier cache fix makes the code behavior intentional, so update the description to describe build-stamped assembly metadata plus run-time layout injection instead of inspection-carried paths.
        var appHostInfo = canQueryCliBundleProperty
            ? await _appHostInfoResolver.GetAppHostInfoAsync(effectiveAppHostFile, cancellationToken)
            : null;
        var injectDcpAndDashboard = appHostInfo?.IsUsingCliBundle == true;

@github-actions

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No new issues found, I think this is good to go!

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) merged commit f65a201 into main Aug 13, 2026
723 of 727 checks passed
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) deleted the dev/karolz/ensure-bundle-availability branch August 13, 2026 22:23
@karolz-ms

Copy link
Copy Markdown
Contributor Author

/backport to release/13.5

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.5 (link to workflow run)

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1496

Generated by PR Documentation Check · auto · 37 AIC · ⌖ 7.03 AIC · ⊞ 19.6K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1496 targeting release/13.5.

Updated get-started/aspire-sdk.mdx to document that the build now runs aspire setup to extract an unextracted CLI bundle before falling back to the ASPIRE009 error, matching the fix's "user-facing behavior" section (IDE/direct launches of AspireUseCliBundle=true AppHosts no longer require a prior aspire command run).

Note

This draft PR needs human review before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AspireE2E] AppHost throws unhandled System.AggregateException when AspireUseCliBundle=true and CLI bundle dependencies are unavailable

3 participants