Repository navigation
Restore Visual Studio Aspire version discovery in empty template - #21506
Jose Perez Rodriguez (joperezr) wants to merge 1 commit into
Conversation
Restore the AspireVersion choice contract and conditionally disable the unused parameter for the Aspire CLI host. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21506Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21506" |
Tests selector3 / 100 PR test projects · 2 PR jobs, from 4 changed files. Selected PR test projects (3 / 100)
Selected PR jobs (2)
How these were chosen — grouped by what changed🔧 🔧 🔧 🔧 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟡 Changes recommended
Non-interactive creation still injects a full SDK preview version into a major/minor-only choice, leaving CLI parameter collection unsafe and requiring an enablement fix plus regression coverage.
What changed in this PR
This template-only proposal restores the version metadata Visual Studio uses to show Enlist in Aspire orchestration, while attempting to keep the unused version parameter disabled for Aspire CLI generation. End-to-end behavior remains unvalidated.
Changes:
- Restore major/minor
AspireVersionchoices using existing packaging placeholders. - Add a host-defaulted
HostIdentifierparameter to control version-parameter enablement. - Hide the internal parameter in Aspire CLI, dotnet CLI, and IDE hosts.
| File | Description |
|---|---|
src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/template.json |
Restores version choices and adds host-specific enablement. |
src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/ide.host.json |
Hides HostIdentifier in IDE hosts. |
src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/dotnetcli.host.json |
Hides HostIdentifier in dotnet CLI. |
src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/aspirecli.host.json |
Hides HostIdentifier in Aspire CLI. |
Review effort: Balanced
| } | ||
| ], | ||
| "defaultValue": "!!REPLACE_WITH_LATEST_MAJOR_MINOR_VERSION!!", | ||
| "isEnabled": "(HostIdentifier != \"aspirecli\")" |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |

Description
Sketch a template-only fix for the missing Enlist in Aspire orchestration checkbox in Visual Studio's new-project dialog with Aspire 17 preview templates.
The empty-app template's
AspireVersionsymbol changed from a choice to a string in #21263. Visual Studio discovers installed Aspire versions from that symbol's choices, so removing them prevents version discovery and hides the orchestration checkbox.Restore the major/minor choice metadata and disable the unused
AspireVersionparameter for the Aspire CLI host. Package references in the generated empty app are already stamped with the full package version during template packaging.The proposed condition uses a hidden
HostIdentifierparameter, populated by the template host's existing default of the same name. The existing lowercasehostIdentifierbind symbol is retained for content and post-action conditions. This distinction is intentional: the CLI's early parameter-condition evaluator does not populate bind symbols before deciding whether to inject its full SDK version. Hide the new internal parameter in the Aspire CLI, dotnet CLI, and IDE host configuration.No Visual Studio, CLI implementation, or template-engine changes are proposed.
cc Phil Henning (@phenning) Damian Edwards (@DamianEdwards)
User-facing usage
The intended behavior is to restore the existing Visual Studio workflow:
The version parameter returns to a numeric major/minor choice, with a host-specific enablement condition:
{ "datatype": "choice", "choices": [ { "choice": "17.0" } ], "defaultValue": "17.0", "isEnabled": "(HostIdentifier != \"aspirecli\")" }The source continues to use the existing packaging placeholders rather than hardcoding
17.0.Validation
This is an unvalidated draft proposal. Do not merge until the PR build has been installed and the reported scenario has been verified with Elena's help.
No build, automated tests, template instantiation, or Visual Studio end-to-end validation has been run. JSON parsing and
git diff --checkpassed; these are syntax/whitespace checks only and do not establish that the fix works.Before checking this in:
AspireVersionwithout rejecting the injected full version or changing generated package references.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?