Skip to content

Add 9.1 templates#7229

Merged
DamianEdwards merged 10 commits intomainfrom
damianedwards/templates-9.1
Jan 28, 2025
Merged

Add 9.1 templates#7229
DamianEdwards merged 10 commits intomainfrom
damianedwards/templates-9.1

Conversation

@DamianEdwards
Copy link
Copy Markdown
Member

@DamianEdwards DamianEdwards commented Jan 23, 2025

Description

Adds 9.1 templates to the template package as the default. The 9.0 templates got updated to use fixed package versions. The 8.2 and 9.0 templates remain in the package as that's our current side-by-side strategy (all template versions in one package) until we get to 10.0 at which point we can decide which versions to drop from the package.

Fixes #7160

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes (existing)
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

Screenshot of Aspire version option in VS:

image

Screenshot of Aspire version option in C# Dev Kit:

image

@eerhardt
Copy link
Copy Markdown
Member

The 8.2 and 9.0 templates remain in the package as that's our current side-by-side strategy (all template versions in one package) until we get to 10.0 at which point we can decide which versions to drop from the package.

This seems like it goes against our support policy, doesn't it? We don't support 9.0 anymore after we ship 9.1. So why should we continue to have 9.0 templates, if we no longer support it?

@DamianEdwards
Copy link
Copy Markdown
Member Author

This seems like it goes against our support policy, doesn't it? We don't support 9.0 anymore after we ship 9.1. So why should we continue to have 9.0 templates, if we no longer support it?

Yes, but it's a huge inconvenience given all the trade-offs we made WRT our approach to template packaging for Aspire. If we remove 9.0 (or 8.2) from the package in the 9.1 update, you can no longer perform Aspire project creation or scaffolding operations in VS or VS Code for 9.0 projects. I can't think of anywhere else in our wider .NET experience where we instantly remove the ability to work with unsupported versions when the new version is released, because doing so would be hugely disruptive. The other advantage of this approach is it makes dogfooding much easier as you can install the daily 9.1 templates package (or even a locally built version) and still work with 9.0 projects/solutions with no issue.

@joperezr
Copy link
Copy Markdown
Member

The 8.2 and 9.0 templates remain in the package as that's our current side-by-side strategy (all template versions in one package) until we get to 10.0 at which point we can decide which versions to drop from the package.

This seems like it goes against our support policy, doesn't it? We don't support 9.0 anymore after we ship 9.1. So why should we continue to have 9.0 templates, if we no longer support it?

As @DamianEdwards has shared in the past, one thing is not supporting it, and a different one is blocking people from using it. One good precedent is the newer SDKs, they allow you to compile assemblies and applications that target out of support framework, while of course warning you that those runtimes are out of support. I think that the change here is following that same pattern, which seems good to me.

@eerhardt
Copy link
Copy Markdown
Member

What happens in .NET Aspire 10? We drop 8.2 templates? Do we drop all 9.x templates as well? When do we ever drop old versions?

@DamianEdwards
Copy link
Copy Markdown
Member Author

@eerhardt undecided, that's something we figure out for 10. My guess is we drop 8.x and everything but the last 9.x

@DamianEdwards
Copy link
Copy Markdown
Member Author

Just realized this needs another fix to allow picking the Aspire version when targeting net9.0 so this isn't ready to go just yet.

"editorTreatAs": "solution",
"aspire-8.2-tfms": "net8.0",
"aspire-9.0-tfms": "net8.0;net9.0"
"aspire-9.0-tfms": "net8.0;net9.0",
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.

Just out of curiosity (not super familiar with these files) how come these tags aren't in all template configs? For instance, aspire-apphost doesn't seem to have this change. Is that intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're only used by the code in VS that drives the solution explorer "Add Aspire orchestration" context menu.


<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_DOTNET_EXTENSIONS_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="!!REPLACE_WITH_LATEST_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.1.0" />
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.

NIT: Should this remain being bumped?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't update the 9.0 templates from this point on

Copy link
Copy Markdown
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a copule of small comments, but this looks good otherwise. Thank you so much for getting this work done @DamianEdwards

@DamianEdwards DamianEdwards marked this pull request as draft January 25, 2025 00:16
"description": "The version of .NET Aspire to use.",
"displayName": ".NET Aspire version",
"datatype": "choice",
"isEnabled": "Framework == net8.0",
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.

I think you can remove the AspireVersionCli symbol entirely if you loosen this enablement condition to allow Framework to be either net8.0 or net9.0. I think this is why --framework net9.0 --aspire-version 9.0 doesn't actually impact the aspire version to be used.

Copy link
Copy Markdown
Member Author

@DamianEdwards DamianEdwards Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my latest commit for what I think should work for VS and CLI, but only works in VS. The commit before that is what I had to do to make it work in both.

@DamianEdwards DamianEdwards marked this pull request as ready for review January 28, 2025 16:31
@DamianEdwards
Copy link
Copy Markdown
Member Author

Due to limitations in the templating experience, I had to change how aspire-empty works specifically so that the VS flows for adding Aspire orchestration via File -> New and Solution Explorer context menu work. They require that the AspireVersion option always be enabled as that's what they set (they don't know about AspireVersionNet9) so just for the empty template it's possible to select net9.0 and Aspire version 8.2 but it will be ignored and use 9.1 instead. The display for that option has been updated to make this clearer:

image

In the CLI scenario it's described like this:

image

FYI @phenning

@github-actions github-actions Bot locked and limited conversation to collaborators Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WebToolsE2E][Aspire] After installing Aspire 9.1 templates, 'dotnet new aspire' does not show 9.1 as a valid version for --aspire-version parameter

4 participants