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

Add 9.1 templates #7229

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Add 9.1 templates #7229

wants to merge 4 commits into from

Conversation

DamianEdwards
Copy link
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
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
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
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
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
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
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.

@@ -21,7 +21,8 @@
"type": "solution",
"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
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
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.

@@ -10,8 +10,8 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<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
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
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
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
],
"defaultValue": "9.1"
},
"AspireVersionNet8": {
"type": "parameter",
"description": "The version of .NET Aspire to use.",
"displayName": ".NET Aspire version",
"datatype": "choice",
"isEnabled": "Framework == net8.0",
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants