don't build apphost in cli when running in extension#12621
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12621Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12621" |
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the build skipping logic in the RunCommand by removing the capability-based check and always skipping the build when running in an extension host context. The change consolidates two previous conditions (extension host with DevKit capability OR single-file apphost) into a simpler approach where any extension host scenario skips the build, and removes the now-unused ShouldBuildAppHostInExtensionAsync helper method.
Key changes:
- Simplified build condition from
!isSingleFileAppHost || isExtensionHostto!isSingleFileAppHost && !isExtensionHost - Removed capability check (
KnownCapabilities.DevKit) for extension hosts - Removed
ShouldBuildAppHostInExtensionAsynchelper method and related logic - Simplified status message display to always show "Building app host" instead of conditionally showing "Connecting to app host"
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Commands/RunCommand.cs | Simplified build skipping logic to unconditionally skip builds when running in extension host, removed DevKit capability check, and deleted unused helper method |
| tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs | Added test case to verify build is skipped when running in extension without requiring DevKit capability |
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19045123423 |
Description
Isolates the CLI change from #12568, because this behavior should be backported to 13. The apphost should always be built in the extension - the extension can choose whether to call dotnet itself or use a registered task provider like c# dev kit.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate