Skip to content

[release/13.5] Enable CLI bundle in C# AppHost templates - #19294

Merged
Jose Perez Rodriguez (joperezr) merged 2 commits into
release/13.5from
backport/pr-19076-to-release/13.5
Aug 12, 2026
Merged

[release/13.5] Enable CLI bundle in C# AppHost templates#19294
Jose Perez Rodriguez (joperezr) merged 2 commits into
release/13.5from
backport/pr-19076-to-release/13.5

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Backport of #19076 to release/13.5

/cc Damian Edwards (@DamianEdwards)

Customer Impact

Defaults all new C# AppHost projects created from templates to use the CLI bundle layout.

Testing

Verified using PR testing skill.

Risk

Low

Regression?

No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63b77c7f-f8cf-4923-8cd7-abaf1ff27a76
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63b77c7f-f8cf-4923-8cd7-abaf1ff27a76
@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 -- 19294

Or

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

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

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates Aspire templates and test infrastructure to opt AppHost projects into the Aspire CLI bundle by default, while ensuring template tests can still opt out via a global MSBuild property.

Changes:

  • Add AspireUseCliBundle=true to AppHost project templates (csproj and single-file apphost.cs).
  • Update test expectations and E2E assertions to align with CLI-bundle startup behavior.
  • Adjust template-test harness command argument handling to avoid passing MSBuild build args to dotnet new, and add a global property opt-out for builds/runs in tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Shared/TemplatesTesting/DotNetNewCommand.cs Avoids appending build/test/run MSBuild args to dotnet new invocations.
tests/Shared/TemplatesTesting/BuildEnvironment.cs Sets a global MSBuild property to opt out of the CLI bundle in template tests.
tests/Shared/TemplatesTesting/AspireProject.cs Passes template-test default MSBuild args into dotnet run.
tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs Updates assertions to require CLI-bundle opt-in in generated single-file AppHost.
tests/Aspire.Cli.EndToEnd.Tests/SingleFileAppHostInitDotnetRunTests.cs Updates E2E expectations for CLI-bundle startup message and generated source.
tests/Aspire.Cli.EndToEnd.Tests/BundleSmokeTests.cs Expects generated AppHost artifacts to already opt into the CLI bundle (no manual patching).
src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj Adds <AspireUseCliBundle>true</AspireUseCliBundle> to template csproj.
src/Aspire.ProjectTemplates/templates/aspire-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj Adds <AspireUseCliBundle>true</AspireUseCliBundle> to template csproj.
src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.AppHost/AspireApplication.1.AppHost.csproj Adds <AspireUseCliBundle>true</AspireUseCliBundle> to template csproj.
src/Aspire.ProjectTemplates/templates/aspire-apphost/Aspire.AppHost1.csproj Adds <AspireUseCliBundle>true</AspireUseCliBundle> to template csproj.
src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/apphost.cs Adds #:property AspireUseCliBundle=true directive to single-file template.
src/Aspire.Cli/Templating/Templates/empty-apphost/apphost.cs Adds #:property AspireUseCliBundle=true directive to CLI-init template.
src/Aspire.Cli/Commands/InitCommand.cs Ensures CLI-init single-file skeleton includes AspireUseCliBundle property directive.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/Shared/TemplatesTesting/DotNetNewCommand.cs
Comment thread src/Aspire.Cli/Commands/InitCommand.cs
@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.

4 / 100 test projects · 5 jobs, from 13 changed files.

Selected test projects (4 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.EndToEnd.Tests, Aspire.Templates.Tests

Selected jobs (5)

cli-starter, deployment-e2e, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

🧪 tests/Shared/TemplatesTesting/AspireProject.cs (changed test)
2 via the project graph: Aspire.EndToEnd.Tests, Aspire.Templates.Tests

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

🔧 src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/apphost.cs (changed source)
1 directly: Aspire.Templates.Tests

🔧 src/Aspire.ProjectTemplates/templates/aspire-apphost/Aspire.AppHost1.csproj (changed source)
1 directly: Aspire.Templates.Tests

🔧 src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.AppHost/AspireApplication.1.AppHost.csproj (changed source)
1 directly: Aspire.Templates.Tests

🔧 src/Aspire.ProjectTemplates/templates/aspire-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj (changed source)
1 directly: Aspire.Templates.Tests

🔧 src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj (changed source)
1 directly: Aspire.Templates.Tests

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

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

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

Job reasons

Job Triggered by
cli-starter • affected project Aspire.Cli
• selected test Aspire.Cli.Tests
deployment-e2e src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/apphost.cs, src/Aspire.ProjectTemplates/templates/aspire-apphost/Aspire.AppHost1.csproj, src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.AppHost/AspireApplication.1.AppHost.csproj, src/Aspire.ProjectTemplates/templates/aspire-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj, src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj
• affected project Aspire.Cli
extension-e2e src/Aspire.Cli/Commands/InitCommand.cs, src/Aspire.Cli/Templating/Templates/empty-apphost/apphost.cs, tests/Aspire.Cli.EndToEnd.Tests/BundleSmokeTests.cs, tests/Aspire.Cli.EndToEnd.Tests/SingleFileAppHostInitDotnetRunTests.cs, tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 6171f88.

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.

Important fix to remove a warning from greenfield. Approved.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit e9d8b87 into release/13.5 Aug 12, 2026
343 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the backport/pr-19076-to-release/13.5 branch August 12, 2026 21:41
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone Aug 12, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

Step 5 branch taken: excluded → backport

Exclusion reasons (from signals.json): base_branch_is_release, head_branch_is_backport, title_release_prefix, body_backport_marker.

This PR is a backport of #19076 to release/13.5: title is prefixed [release/13.5], the head branch is a bot-created backport branch, and the PR body contains Backport of #19076 to release/13.5. Per workflow policy, backport PRs are out of scope for docs generation—documentation for this change should be authored against the original forward PR (#19076) on the default branch, not duplicated here.

Triggered signals (informational only, not used since excluded=true): cli_command_file_changed, project_template_changed (signal_count=2, recommendation=docs_optional).

No docs PR was drafted.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants