Repository navigation
Remove redundant CLI bundle opt-ins from templates - #21986
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21986Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21986" |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes removing redundant CLI bundle opt-ins.
No open issues 🎉
What changed in this PR
Removes redundant CLI bundle opt-ins from generated C# AppHosts, allowing current SDK defaults and inherited settings to take effect while preserving compatibility with older SDKs.
Changes:
- Removes explicit bundle settings from project templates, single-file templates, and
aspire init. - Retains explicit opt-in directives for versions before 17.0 and all 17.0.0 prereleases.
- Updates generation, SDK, and end-to-end tests to cover default behavior and inherited disabling.
| File | Description |
|---|---|
tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs |
Tests bundle defaults and inherited disabling. |
tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_FileBased_SkipsSolutionDiscovery.verified.txt |
Updates expected output without the opt-in. |
tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs |
Verifies version-dependent generated directives. |
tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs |
Tests version-compatible init skeletons. |
tests/Aspire.Cli.EndToEnd.Tests/SingleFileAppHostInitDotnetRunTests.cs |
Checks init output with no environment override. |
tests/Aspire.Cli.EndToEnd.Tests/BundleSmokeTests.cs |
Checks project and single-file bundle defaults. |
src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj |
Removes the mixed-language starter opt-in. |
src/Aspire.ProjectTemplates/templates/aspire-starter/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj |
Removes the starter project opt-in. |
src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.AppHost/AspireApplication.1.AppHost.csproj |
Removes the empty project opt-in. |
src/Aspire.ProjectTemplates/templates/aspire-apphost/Aspire.AppHost1.csproj |
Removes the AppHost project opt-in. |
src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/apphost.cs |
Removes the single-file template opt-in. |
src/Aspire.Cli/Templating/Templates/empty-apphost/apphost.cs |
Delegates bundle directives to version-aware generation. |
src/Aspire.Cli/Templating/CliTemplateFactory.EmptyTemplate.cs |
Emits bundle opt-ins only for older versions. |
src/Aspire.Cli/Commands/InitCommand.cs |
Uses shared version-aware directives without an unconditional opt-in. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
7368c79 to
4eea94e
Compare
|
/backport to release/17.0 |
|
Started backporting to |
|
Eric Erhardt (@eerhardt) backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Remove redundant CLI bundle setting from templates
Using index info to reconstruct a base tree...
M tests/Aspire.Cli.EndToEnd.Tests/SingleFileAppHostInitDotnetRunTests.cs
M tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Cli.EndToEnd.Tests/SingleFileAppHostInitDotnetRunTests.cs
Auto-merging tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs
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 0001 Remove redundant CLI bundle setting from templates
Error: The process '/usr/bin/git' failed with exit code 128 |
Tests selector4 / 101 PR test projects · 6 PR jobs, from 14 changed files. Selected PR test projects (4 / 101)
Selected PR jobs (6)
How these were chosen — grouped by what changed🔧 🔧 🔧 🔧 🔧 📦 affected project 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Pull request created: #2137
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2137 targeting Updated Note This draft PR needs human review before merging. |

Description
Current C# AppHost SDKs enable the CLI bundle by default. Remove the redundant opt-in from the project and single-file templates and from
aspire init.Previously, generated project files contained
<AspireUseCliBundle>true</AspireUseCliBundle>and single-file AppHosts contained#:property AspireUseCliBundle=true. Current templates now omit those settings. CLI generation still emits the directive for versions before 17.0 and all 17.0.0 prereleases, because their defaults can differ.This also allows an explicitly inherited
AspireUseCliBundle=falsefrom the environment orDirectory.Build.propsto take effect instead of being overridden by the generated project. The SDK reports ASPIRE013 in that configuration.Validation
Fixes # (issue)
cc Damian Edwards (@DamianEdwards) Karol Zadora-Przylecki (@karolz-ms) Mitch Denny (@mitchdenny)
Checklist
<remarks />and<code />elements on your triple slash comments?