Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple AspireVersion options shown in VS Code C# Dev Kit for Aspire templates #7391

Open
DamianEdwards opened this issue Feb 3, 2025 · 5 comments
Assignees
Labels
area-templates area-tooling vs-code Issues related to vs code tooling for aspire
Milestone

Comments

@DamianEdwards
Copy link
Member

Seems the 9.1 template change to use two separate options for AspireVersion that are dynamically enabled/disabled based on the selected target framework doesn't work in C# Dev Kit:

Image

@phenning is that something you own now?

@DamianEdwards DamianEdwards added area-templates area-tooling vs-code Issues related to vs code tooling for aspire labels Feb 3, 2025
@DamianEdwards DamianEdwards added this to the 9.1 milestone Feb 3, 2025
@DamianEdwards DamianEdwards added the untriaged New issue has not been triaged label Feb 3, 2025
@bradygaster
Copy link
Member

@LittleLittleCloud can you take a look at this?

@bradygaster bradygaster removed the untriaged New issue has not been triaged label Feb 3, 2025
@DamianEdwards
Copy link
Member Author

Note that in Visual Studio, the File -> New Project dialog experience hides options dynamically as their enabled status changes based on the values selected for other options, which is why it works fine there.

@phenning
Copy link
Contributor

phenning commented Feb 4, 2025

There are a few places we need to address this if we fully want to implement conditional parameters. One of the issues is that in VS code, we don't have full conditional support, the current support appears to be limited to checking if a parameter is set to a value in a set (with some negation options as well), so to do full conditional support, we'd need a parser which we don't have.

I think we may be able to get by with a targetted fix for aspire instead of fully supporting the full range of conditional parameters, we could just update the Generic Parameter provider to look at the isEnabled properties which are used in the template, and pattern match to try to pull out the framework parameters in order to restrict the framework choice even further for each option. We can add full conditional support to the long term backlog.

These is what we would need to match.
"isEnabled": "Framework == net9.0"
and
"isEnabled": "(Framework == net8.0 || hostIdentifier == dotnetcli || hostIdentifier == "dotnetcli-preview")",

@DamianEdwards
Copy link
Member Author

I think the second one can be simplified to just "isEnabled":"Framework == net8.0" as we have a separate option for the CLI now. I think the rest of that condition is obsolete now and could be removed.

@phenning
Copy link
Contributor

phenning commented Feb 4, 2025

Could you try it out and update the template if everything is fine on VS and the CLI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-templates area-tooling vs-code Issues related to vs code tooling for aspire
Projects
None yet
Development

No branches or pull requests

4 participants