Add aspire update
command to streamline updating Aspire packages in AppHost projects
#9991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a new
aspire update
command that provides a streamlined way to update Aspire.Hosting.* and CommunityToolkit.Aspire.Hosting.* packages in AppHost projects.Features
Command Usage
Core Functionality
Project Discovery: Uses
IProjectLocator
to find AppHost projects with support for:--project
option to specify explicit project pathPackage Detection: Automatically identifies packages in these namespaces:
Aspire.Hosting.*
CommunityToolkit.Aspire.Hosting.*
Update Check: Checks for available updates (currently uses stub logic for demonstration)
User Confirmation: Shows clear from/to version information:
Package Updates: Uses
dotnet add package
to update packagesImplementation Details
BaseCommand
Program.cs
andRootCommand
.resx
filesFiles Changed
New Files
src/Aspire.Cli/Commands/UpdateCommand.cs
- Main command implementationsrc/Aspire.Cli/Resources/UpdateCommandStrings.resx
- Localized stringssrc/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs
- Generated resource accessortests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs
- Test suite.xlf
files for localizationModified Files
src/Aspire.Cli/Program.cs
- Added UpdateCommand to DI containersrc/Aspire.Cli/Commands/RootCommand.cs
- Added UpdateCommand to CLIFuture Enhancements (TODOs)
The command provides a solid foundation with these areas marked for future enhancement:
AspireHostingSDKVersion
in project file whenAspire.Hosting.AppHost
is updatedAspire.Hosting.AppHost
version with SDK versionTesting
The command is production-ready for the basic update flow and provides the foundation for the advanced features marked as TODOs.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.