Skip to content

Fix VS Code AppHost launch path resolution - #17408

Merged
Adam Ratzman (adamint) merged 21 commits into
mainfrom
codex/vscode-apphost-launch-path
May 27, 2026
Merged

Adam Ratzman (adamint) merged 21 commits into
mainfrom
codex/vscode-apphost-launch-path

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented May 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This fixes VS Code AppHost launch path handling when users run or debug Aspire from source files instead of project files. Previously, starting an Aspire debug session from an SDK-style C# AppHost source file such as Program.cs could pass that source path through to the Aspire CLI as --apphost <path>/Program.cs, which the CLI does not accept for SDK-style AppHosts.

The extension now uses CLI-backed AppHost discovery as the source of truth for launch targets:

  • aspire ls --format json discovers AppHost candidates for the workspace.
  • aspire ls also includes the AppHost configured in aspire.config.json, even when that AppHost lives outside the current working directory's normal discovery results.
  • SDK-style C# AppHost source files under a discovered .csproj resolve to that project file before launch.
  • Single-file C# AppHosts and TypeScript/JavaScript AppHosts continue to launch from their discovered source file paths.
  • Launch configurations are normalized after VS Code variable substitution, so ${workspaceFolder}/AppHost/Program.cs can resolve to the discovered AppHost project.
  • Debug configuration providers, editor Run/Debug contexts, and the AppHost tree share the same discovery service and refresh when AppHost-related files or config files change.
  • Discovery failures are handled defensively in editor and debug-provider paths so stale VS Code contexts or transient CLI discovery failures do not break Run/Debug flows.
  • Discovery CLI processes are tracked, cancelled on dispose, and timed out so hung discovery does not leave permanently cached pending promises.
  • File watcher invalidations ignore output and vendor directories before clearing discovery cache.

User-facing usage

Users can still point an Aspire launch configuration at the AppHost project file:

{
  "type": "aspire",
  "request": "launch",
  "program": "${workspaceFolder}/AppHost/AppHost.csproj"
}

If a user starts debugging while an SDK-style AppHost source file is active, or a launch configuration points at that source file, the extension resolves the launch target to the containing discovered AppHost project before invoking the CLI. Single-file AppHosts still launch directly from source:

#:sdk Aspire.AppHost.Sdk

var builder = DistributedApplication.CreateBuilder(args);
builder.Build().Run();

TypeScript AppHosts discovered by the CLI continue to launch from the source file path:

import { createBuilder } from './.aspire/modules/aspire';

Fixes # (issue)

Validation

  • npm run compile-tests -- --pretty false
  • npm run unit-test -- --grep "AspireDebugConfigurationProvider"
  • npm run unit-test -- --grep "TypeScript apphost|AspireEditorCommandProvider|AppHost discovery|AspireDebugConfigurationProvider"
  • dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.LsCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • C# AppHost discovery: cd tests/testproject && aspire ls --format json
  • Local CLI configured AppHost discovery: temporary workspace with aspire.config.json pointing outside the working directory, then dotnet run --project src/Aspire.Cli/Aspire.Cli.csproj -- ls --format json verified the configured AppHost is included.
  • TypeScript AppHost discovery: created a temporary workspace with aspire init --language typescript --suppress-agent-init --non-interactive, then ran aspire ls --format json and verified it returns the apphost.ts candidate with language: "typescript/nodejs".
  • git diff --check

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

@github-actions

github-actions Bot commented May 23, 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 -- 17408

Or

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

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

This PR fixes Aspire VS Code extension launch path handling so that when users start an Aspire debug session from an SDK-style C# AppHost source file (typically Program.cs), the extension resolves that source path to the containing AppHost project (.csproj) before invoking the Aspire CLI via --apphost.

Changes:

  • Added resolveAppHostLaunchPath utility to normalize C# AppHost launch paths (Program.cs → containing project; single-file #:sdk Aspire.AppHost.Sdk stays as source).
  • Updated AspireEditorCommandProvider.getAppHostPath() to return the normalized launch path when launching from the active editor.
  • Updated AspireDebugConfigurationProvider.resolveDebugConfigurationWithSubstitutedVariables() to normalize launch.json program values post-substitution, with unit tests covering key scenarios.
Show a summary per file
File Description
extension/src/utils/appHostLaunchPath.ts Introduces the path normalization logic for C# AppHost launches.
extension/src/editor/AspireEditorCommandProvider.ts Uses normalization when launching from the active editor’s AppHost file.
extension/src/debugger/AspireDebugConfigurationProvider.ts Normalizes program after variable substitution for launch configs.
extension/src/test/aspireEditorCommandProvider.test.ts Adds unit tests for active-editor launch path normalization.
extension/src/test/aspireDebugConfigurationProvider.test.ts Adds unit tests for launch configuration normalization behavior.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 1

@davidfowl

Copy link
Copy Markdown
Collaborator Author

Replying to Copilot review overview #17408 (review): thanks for the review. The PR has since been refactored from the original resolveAppHostLaunchPath utility to shared CLI-backed AppHost discovery, so the stale overview no longer reflects the current file layout and no code change was needed for this summary.

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.

Reviewed the AppHost discovery refactor. Found 2 issues:\n\n- 1 resource leak/correctness issue: Spawned CLI process in runCliForStdout is never tracked — no timeout, no kill-on-dispose, and a hung process permanently blocks the cached discovery promise for the workspace.\n- 1 performance issue: File system watchers use broad **/*.csproj patterns without excluding build output directories, which can trigger excessive CLI re-invocations during builds in large workspaces.

Comment thread extension/src/utils/appHostDiscovery.ts Resolved
Comment thread extension/src/utils/appHostDiscovery.ts Resolved
@davidfowl

Copy link
Copy Markdown
Collaborator Author

Replying to review summary #17408 (review): thanks, agreed on both points. I addressed the inline threads in c3c8505 by adding discovery CLI timeout/cancellation on dispose and filtering watcher invalidations for output and vendor directories.

@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

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.

1 issue found (logic bug in selectWorkspaceAppHostPath loop control flow).

Comment on lines +423 to +431
const candidate = candidates.find(candidate => isSamePath(candidate.path, configuredPath));
if (candidate) {
return candidate.path;
}

return configuredPath;
}

return candidates.length === 1 ? candidates[0].path : undefined;

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.

Bug: Loop always exits on first iteration — The unconditional return configuredPath at the end of the loop body means the loop can never iterate past the first element. If there are multiple configured paths (e.g., nested aspire.config.json files in a monorepo) and the first one doesn't match any discovered candidate, subsequent paths are never checked.

If the intent is "configured paths always take priority regardless of discovery", the loop is misleading and equivalent to if (configuredPaths.length > 0) return configuredPaths[0].

If the intent is "prefer configured paths that match a discovered candidate, falling through to the single-candidate check otherwise", the return configuredPath should be removed so non-matching paths are skipped:

for (const configuredPath of configuredPaths) {
    const candidate = candidates.find(candidate => isSamePath(candidate.path, configuredPath));
    if (candidate) {
        return candidate.path;
    }
    // non-matching configured path — try next
}

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.

Fixed in 257c815: selectWorkspaceAppHostPath now continues through all configured paths and only falls back after the loop, with a regression test covering multiple config files where a later configured path matches a discovered candidate.

Validated with:

  • npm run compile-tests -- --pretty false
  • npm run unit-test -- --grep "AppHost discovery"

Ensure workspace AppHost selection checks all configured paths before falling back to the single discovered candidate, and add a regression test for multiple config files.\n\nCo-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@davidfowl

Copy link
Copy Markdown
Collaborator Author

oops

@adamint

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

CLI Version Verification

  • Expected Commit: 0b79866
  • Installed Version: 13.5.0-pr.17408.g0b798663
  • Status: Verified (version includes 0b79866)

Changes Analyzed

  • CLI/AppHost lifecycle and project discovery changes in src/Aspire.Cli.
  • VS Code extension AppHost discovery, debug configuration, localization packaging, and tests.
  • Template .gitignore updates for language starters.

Test Scenarios Executed

Scenario 1: File-based AppHost create, discover, start, describe, stop

Objective: Verify the PR CLI can create a fresh file-based AppHost, discover it, start it in isolated mode, query state, and stop it cleanly.
Coverage Type: Happy path
Status: Passed

Evidence:

  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario1c-new.log
  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario1c-ls.json
  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario1c-start.json
  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario1c-describe.json
  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario1c-stop.log

Scenario 2: Invalid AppHost path fails safely

Objective: Verify explicit invalid AppHost paths produce a non-zero result instead of selecting/running the wrong project.
Coverage Type: Unhappy path
Status: Passed
Expected Unhappy-Path Outcome: Non-zero exit with a clear error for the missing AppHost path.

Evidence:

  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario2-invalid-apphost.log

Scenario 3: AppHost discovery respects .gitignore unless --all is used

Objective: Validate project discovery behavior around ignored AppHost paths changed by the PR's locator work.
Coverage Type: Boundary
Status: Passed

Evidence:

  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario3b-ls-default.json
  • /var/folders/jt/y4c1v32j5hg8gg47g4m_ztvr0000gn/T/aspire-pr-test-XXXXXX.dLZ5iA9Xci/logs/scenario3b-ls-all.json

Extension Test Coverage

Objective: Verify the VS Code extension unit/integration test suite after the Windows CI failure fix.
Coverage Type: Regression
Status: Passed

Evidence:

  • Local extension npm test: 587 passing
  • CI Tests / Run VS Code extension tests (Windows): success on run 26529974864

Non-blocking Observation

An initial aspire-starter smoke attempt failed when the dogfood CLI used its bundled/private .NET SDK (10.0.201) to build the generated Blazor web project from a fresh checkout. A direct build with a newer local .NET 10 SDK succeeded, and this PR does not modify the C# starter template or private SDK selection. I replaced that broad starter smoke with the targeted file-based AppHost scenario above to cover the PR's AppHost launch/discovery behavior.

Summary

Scenario Status Notes
File-based AppHost create/discover/start/describe/stop Passed Uses PR CLI and PR template hive
Invalid AppHost path Passed Expected non-zero safe failure
Discovery .gitignore / --all boundary Passed Validates locator filter behavior
VS Code extension tests Passed Local and Windows CI regression coverage

Overall Result

PR VERIFIED

Adam Ratzman (adamint) and others added 4 commits May 27, 2026 14:58
Use the existing fake container runtime resolver in the pipeline unit test context so the built-in container runtime check doesn't depend on Docker availability on CI runners.

Co-authored-by: Copilot <[email protected]>
Keep the fake container runtime service-provider lookup null-safe and explicit.

Co-authored-by: Copilot <[email protected]>
@adamint
Adam Ratzman (adamint) enabled auto-merge (squash) May 27, 2026 21:09
@adamint
Adam Ratzman (adamint) merged commit 00eff9d into main May 27, 2026
616 of 619 checks passed
@adamint
Adam Ratzman (adamint) deleted the codex/vscode-apphost-launch-path branch May 27, 2026 21:10
@github-actions

Copy link
Copy Markdown
Contributor

❓ CLI E2E Tests unknown — 107 passed, 0 failed, 2 unknown (commit 134d0ca)

View all recordings
Status Test Recording
✅ AddPackageInteractiveWhileAppHostRunningDetached ✅ ▶️ View recording
✅ AddPackageWhileAppHostRunningDetached ✅ ▶️ View recording
✅ AgentCommands_AllHelpOutputs_AreCorrect ✅ ▶️ View recording
✅ AgentInitCommand_DefaultSelection_InstallsDefaultSkills ✅ ▶️ View recording
✅ AgentInitCommand_MigratesDeprecatedConfig ✅ ▶️ View recording
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp ✅ ▶️ View recording
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost ✅ ▶️ View recording
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated ✅ ▶️ View recording
✅ AllPublishMethodsBuildDockerImages ✅ ▶️ View recording
✅ AspireAddAndStartWorkAgainstLegacyAppHostTs ✅ ▶️ View recording
✅ AspireAddPackageVersionToDirectoryPackagesProps ✅ ▶️ View recording
✅ AspireInitSingleFileAppHostRunsViaDotnetRunAppHost ✅ ▶️ View recording
✅ AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles ✅ ▶️ View recording
❔ AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive ❔ ▶️ View recording
✅ AspireStartUpdatesStaleTypeScriptAppHostPath ✅ ▶️ View recording
✅ AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ✅ ▶️ View recording
✅ AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent ✅ ▶️ View recording
✅ Banner_DisplayedOnFirstRun ✅ ▶️ View recording
✅ Banner_DisplayedWithExplicitFlag ✅ ▶️ View recording
✅ Banner_NotDisplayedWithNoLogoFlag ✅ ▶️ View recording
✅ CertificatesClean_RemovesCertificates ✅ ▶️ View recording
✅ CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ✅ ▶️ View recording
✅ CertificatesTrust_WithUntrustedCert_TrustsCertificate ✅ ▶️ View recording
✅ ConfigSetGet_CreatesNestedJsonFormat ✅ ▶️ View recording
✅ CreateAndRunAspireStarterProject ✅ ▶️ View recording
✅ CreateAndRunAspireStarterProjectWithBundle ✅ ▶️ View recording
✅ CreateAndRunEmptyAppHostProject ✅ ▶️ View recording
✅ CreateAndRunJavaEmptyAppHostProject ✅ ▶️ View recording
✅ CreateAndRunJsReactProject ✅ ▶️ View recording
✅ CreateAndRunPythonReactProject ✅ ▶️ View recording
✅ CreateAndRunTypeScriptEmptyAppHostProject ✅ ▶️ View recording
✅ CreateAndRunTypeScriptStarterProject ✅ ▶️ View recording
✅ CreateJavaAppHostWithViteApp ✅ ▶️ View recording
✅ CreateTypeScriptAppHostWithViteApp_AllowsGuestAppPackageManagerToDiffer ✅ ▶️ View recording
✅ CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ✅ ▶️ View recording
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces ✅ ▶️ View recording
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost ✅ ▶️ View recording
✅ DashboardRunWithOtelTracesReturnsNoTraces ✅ ▶️ View recording
✅ DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost ✅ ▶️ View recording
✅ DeployK8sBasicApiService ✅ ▶️ View recording
✅ DeployK8sWithExternalHelmChart ✅ ▶️ View recording
✅ DeployK8sWithGarnet ✅ ▶️ View recording
✅ DeployK8sWithMongoDB ✅ ▶️ View recording
✅ DeployK8sWithMySql ✅ ▶️ View recording
✅ DeployK8sWithPostgres ✅ ▶️ View recording
✅ DeployK8sWithRabbitMQ ✅ ▶️ View recording
✅ DeployK8sWithRedis ✅ ▶️ View recording
✅ DeployK8sWithSqlServer ✅ ▶️ View recording
✅ DeployK8sWithValkey ✅ ▶️ View recording
✅ DeployTypeScriptAppToKubernetes ✅ ▶️ View recording
✅ DescribeCommandResolvesReplicaNames ✅ ▶️ View recording
✅ DescribeCommandShowsRunningResources ✅ ▶️ View recording
✅ DetachFormatJsonProducesValidJson ✅ ▶️ View recording
✅ DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ✅ ▶️ View recording
✅ DoPublishAndDeployListStepsWork ✅ ▶️ View recording
✅ DocsCommand_RendersInteractiveMarkdownFromLocalSource ✅ ▶️ View recording
✅ DoctorCommand_DetectsDeprecatedAgentConfig ✅ ▶️ View recording
✅ DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ✅ ▶️ View recording
✅ DoctorCommand_WithSslCertDir_ShowsTrusted ✅ ▶️ View recording
✅ DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ✅ ▶️ View recording
✅ GatewayWithoutExternalEndpoint_FailsPublishWithGuidance ✅ ▶️ View recording
✅ GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain ✅ ▶️ View recording
✅ GlobalMigration_HandlesCommentsAndTrailingCommas ✅ ▶️ View recording
✅ GlobalMigration_HandlesMalformedLegacyJson ✅ ▶️ View recording
✅ GlobalMigration_PreservesAllValueTypes ✅ ▶️ View recording
✅ GlobalMigration_SkipsWhenNewConfigExists ✅ ▶️ View recording
✅ GlobalSettings_MigratedFromLegacyFormat ✅ ▶️ View recording
✅ IngressWithoutExternalEndpoint_FailsPublishWithGuidance ✅ ▶️ View recording
✅ InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory ✅ ▶️ View recording
✅ InteractiveCSharpInitCreatesExpectedFiles ✅ ▶️ View recording
✅ InvalidAppHostPathWithComments_IsHealedOnRun ✅ ▶️ View recording
✅ JavaScriptHostingApisRunFromTypeScriptAppHost ✅ ▶️ View recording
✅ LatestCliCanStartStableChannelAppHost ✅ ▶️ View recording
✅ LatestCliCanStartStableChannelTypeScriptAppHost ✅ ▶️ View recording
✅ LegacySettingsMigration_AdjustsRelativeAppHostPath ✅ ▶️ View recording
✅ LogsCommandShowsResourceLogs ✅ ▶️ View recording
✅ OtelLogsReturnsStructuredLogsFromStarterApp ✅ ▶️ View recording
✅ OtelLogsReturnsStructuredLogsFromStarterAppIsolated ✅ ▶️ View recording
✅ PsCommandListsRunningAppHost ✅ ▶️ View recording
✅ PsFormatJsonOutputsOnlyJsonToStdout ✅ ▶️ View recording
✅ PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts ✅ ▶️ View recording
✅ PublishWithConfigureEnvFileUpdatesEnvOutput ✅ ▶️ View recording
✅ PublishWithDockerComposeServiceCallbackSucceeds ✅ ▶️ View recording
✅ PublishWithoutOutputPathUsesAppHostDirectoryDefault ✅ ▶️ View recording
✅ ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries ✅ ▶️ View recording
✅ ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput ✅ ▶️ View recording
✅ RestoreGeneratesSdkFiles ✅ ▶️ View recording
✅ RestoreGeneratesSdkFiles_WithConfiguredToolchain ✅ ▶️ View recording
✅ RestoreRefreshesGeneratedSdkAfterAddingIntegration ✅ ▶️ View recording
✅ RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ✅ ▶️ View recording
✅ RunFromParentDirectory_UsesExistingConfigNearAppHost ✅ ▶️ View recording
✅ RunReportsSyntaxErrorsForDotNetAppHost ✅ ▶️ View recording
✅ RunReportsSyntaxErrorsForTypeScriptAppHost ✅ ▶️ View recording
✅ SecretCrudOnDotNetAppHost ✅ ▶️ View recording
✅ SecretCrudOnTypeScriptAppHost ✅ ▶️ View recording
✅ StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ✅ ▶️ View recording
✅ StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ✅ ▶️ View recording
✅ StartReportsSyntaxErrorsForDotNetAppHost ✅ ▶️ View recording
✅ StartReportsSyntaxErrorsForTypeScriptAppHost ✅ ▶️ View recording
✅ StopAllAppHostsFromAppHostDirectory ✅ ▶️ View recording
✅ StopJavaPolyglotAppHostUsingApphostDirectory ✅ ▶️ View recording
✅ StopNonInteractiveSingleAppHost ✅ ▶️ View recording
✅ StopTypeScriptPolyglotAppHostUsingApphostDirectory ✅ ▶️ View recording
✅ StopWithNoRunningAppHostExitsSuccessfully ✅ ▶️ View recording
✅ UnAwaitedChainsCompileWithAutoResolvePromises ✅ ▶️ View recording
❔ UpdateProjectChannelToStable_CSharpEmptyAppHost_PreservesAspireConfigChannel ❔ ▶️ View recording
✅ UpdateProjectChannelToStable_CSharpSingleFileInit_PreservesAspireConfigChannel ✅ ▶️ View recording
✅ UpdateProjectChannelToStable_TypeScriptSingleFileInit_PreservesAspireConfigChannel ✅ ▶️ View recording
✅ UpdateProjectChannelToStable_TypeScript_PreviewsStablePackagesAndPreservesChannel ✅ ▶️ View recording

📹 Recordings uploaded automatically from CI run #26535148153

@adamint

Copy link
Copy Markdown
Member

/backport to release/13.4

@github-actions

Copy link
Copy Markdown
Contributor

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

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Adam Ratzman (@adamint) backporting to release/13.4 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix VS Code AppHost launch path resolution
Applying: Use aspire ls for extension AppHost discovery
Using index info to reconstruct a base tree...
M	extension/src/extension.ts
M	extension/src/test/appHostDataRepository.test.ts
M	extension/src/test/appHostTreeView.test.ts
M	extension/src/utils/workspace.ts
M	extension/src/views/AppHostDataRepository.ts
Falling back to patching base and 3-way merge...
Auto-merging extension/src/extension.ts
Auto-merging extension/src/test/appHostDataRepository.test.ts
CONFLICT (content): Merge conflict in extension/src/test/appHostDataRepository.test.ts
Auto-merging extension/src/test/appHostTreeView.test.ts
CONFLICT (content): Merge conflict in extension/src/test/appHostTreeView.test.ts
Auto-merging extension/src/utils/workspace.ts
CONFLICT (content): Merge conflict in extension/src/utils/workspace.ts
Auto-merging extension/src/views/AppHostDataRepository.ts
CONFLICT (content): Merge conflict in extension/src/views/AppHostDataRepository.ts
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Use aspire ls for extension AppHost discovery
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request May 27, 2026
Update the VS Code extension page to explain how the extension
resolves AppHost launch paths before invoking the Aspire CLI:

- SDK-style C# AppHosts: source files (Program.cs) resolve to .csproj
- Single-file C# AppHosts: launch from source path directly
- TypeScript/JavaScript AppHosts: launch from source path

Mentions that AppHost discovery uses 'aspire ls'.

Documents microsoft/aspire#17408.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1104

Generated by PR Documentation Check

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1104 targeting release/13.4.

Updated src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx to document the new AppHost launch path resolution behavior introduced by this PR. Added an AppHost launch path resolution subsection explaining the three-way rule (SDK-style C# → resolves to .csproj; single-file C# with #:sdk directive → source path; TypeScript/JS → source path), a tip showing explicit .csproj usage, and updated the discovery sentence to mention aspire ls.

Note

This draft PR needs human review before merging.

David Fowler (davidfowl) added a commit that referenced this pull request May 28, 2026
* Fix VS Code AppHost launch path resolution

* Use aspire ls for extension AppHost discovery

* Refresh AppHost discovery consumers on changes

* Use CLI language ids for AppHost discovery

* Handle AppHost discovery failures in editor commands



* Add TypeScript AppHost launch discovery coverage



* Harden AppHost discovery process handling



* Honor configured AppHosts in discovery



* Consolidate extension AppHost discovery



* Fix workspace test path separators



* Fix AppHost configured path selection

Ensure workspace AppHost selection checks all configured paths before falling back to the single discovered candidate, and add a regression test for multiple config files.\n\nCo-authored-by: Copilot <[email protected]>

* Keep extension-launched AppHost CLI alive

Keep the Aspire CLI process alive after VS Code launches an AppHost so the CLI-owned backchannel remains available for the lifetime of the extension-managed debug session. Propagate extension backchannel startup failures instead of returning success.

Also ignore generated .modules directories for polyglot AppHosts.



* Update extension build and CLI debug logging



* Address AppHost launch review feedback

Keep extension-managed CLI runs alive only until the AppHost backchannel disconnects, align configured AppHost discovery UX with scanned candidates, restore dynamic debug fallbacks, and return no disposable for async workspace prompts.

Restore Yarn 1 frozen install compatibility for extension CI and avoid the npx package-name/bin-name mismatch in localization export.



* Address extension discovery review feedback



* Stabilize pipeline unit tests without Docker

Use the existing fake container runtime resolver in the pipeline unit test context so the built-in container runtime check doesn't depend on Docker availability on CI runners.



* Use ordinal comparison in pipeline test provider

Keep the fake container runtime service-provider lookup null-safe and explicit.



* Revert pipeline test isolation changes



---------



(cherry picked from commit 00eff9d)

Co-authored-by: David Fowler <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants