aspire update command
यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।
aspire update - Update Aspire packages and templates in your project.
Synopsis
Section titled “Synopsis”aspire update [options]Description
Section titled “Description”The aspire update command helps you keep your Aspire projects current by automatically detecting and updating outdated packages and templates. It finds outdated Aspire NuGet packages while respecting channel configurations and intelligently handles complex dependency graphs.
The Aspire CLI uses the following logic, in order, to determine which AppHost project to process:
-
The
--apphostoption.This option specifies the path to the Aspire AppHost project file to process.
-
The rooted
aspire.config.jsonfile.If the rooted config exists in the current directory, it’s used. If not, the CLI walks up the directory structure looking for it. If Aspire finds the rooted config, it uses the recorded AppHost information to determine which project to process. Legacy
.aspire/settings.jsonfiles are still read during migration. -
Searches the current directory and subdirectories.
Starting in the current directory, the CLI gathers all AppHost projects from that directory and below. If a single project is discovered, it’s automatically selected. If multiple projects are discovered, they’re printed to the terminal for the user to manually select one of the projects.
Once a project is selected, either automatically or manually, Aspire records that selection in the rooted configuration so later commands can reuse it.
The command performs the following:
- Detects outdated Aspire NuGet packages in your project
- Respects your configured Aspire channel (preview, stable, etc.)
- Resolves diamond dependencies to avoid duplicate updates
- Applies all package version edits before running a single final
dotnet restore, so channel switches that add NuGet source mappings don’t cause restore failures mid-update - Provides colorized output with detailed summary of changes
Non-interactive usage
Section titled “Non-interactive usage”When you use --non-interactive, also pass --yes to explicitly confirm the update operation. Omitting --yes when using --non-interactive is an error:
aspire update --yes --non-interactiveIf you specify --non-interactive without --yes, the command exits with an error:
The update command requires --yes when the --non-interactive option is specified.Updating guest AppHost projects
Section titled “Updating guest AppHost projects”When updating a guest AppHost project, such as a TypeScript AppHost, aspire update checks the selected Aspire SDK version before modifying files. If the selected SDK is newer than the running Aspire CLI, the command prompts you to update the CLI first:
The selected Aspire SDK is newer than this Aspire CLI. Update the Aspire CLI now and re-run `aspire update` to update this project?If you confirm, the CLI updates itself and skips the project update. When the CLI is installed from npm or as a .NET tool, the command prints the matching package-manager update command to run manually instead:
Project update skipped. Update the Aspire CLI, then re-run `aspire update`.After updating the CLI, re-run aspire update to complete the project update. This check helps prevent a guest AppHost project from being left in a broken state when the CLI’s bundled code generator doesn’t support the selected SDK version.
Updating the CLI based on how it was installed
Section titled “Updating the CLI based on how it was installed”aspire update --self (and the update notice shown when a newer version is available) adapts to how the CLI was installed so it doesn’t overwrite files owned by a package manager:
-
When the CLI was installed from npm (the
@microsoft/aspire-clipackage), the command prints the npm update command to run instead of downloading a new binary:Output To update the Aspire CLI when installed from npm, run:npm install -g @microsoft/aspire-cli@latest -
When the CLI was installed with the install script or another binary install,
aspire update --selfdownloads and installs the latest CLI binary directly. -
When the CLI was installed as a .NET tool, the command prints the
dotnet tool updatecommand to run.
Options
Section titled “Options”The following options are available:
-
--apphost <apphost>The path to the Aspire AppHost file or project file, such as
apphost.mts,apphost.cs, or an AppHost.csproj. -
--selfUpdate the Aspire CLI itself to the latest version. The CLI adapts to how it was installed: npm and .NET tool installs print the matching package-manager command to run, while install-script and other binary installs download the latest binary directly. See Updating the CLI based on how it was installed.
-
--channelChannel to update to (
stable,staging,daily). When switching channels,aspire updateapplies all package version edits to your project first and then runs a singledotnet restore, ensuring that NuGet source mappings added for the target channel are in place before any restore is attempted.When you switch to a persistable channel, such as
daily,aspire updatealso rewrites the top-levelchannelkey inaspire.config.jsonwhen the file already exists. Only channels registered as explicit channels are persisted, with one exception: thestablechannel is treated as the portable default and is intentionally not pinned. The persisted channel keeps subsequentaspire addandaspire updateruns resolving packages against the channel you just switched to. -
-y, --yesAutomatically confirm all prompts without user input. Use this option in CI/CD pipelines or other non-interactive environments to skip confirmation dialogs.
-
--nuget-config-dirPath to the directory containing the
NuGet.Configfile to use when searching for packages. When not specified, the command searches for aNuGet.Configfile in the current directory and its parents. -
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Examples
Section titled “Examples”-
Analyze and update out-of-date Aspire packages and templates:
Aspire CLI aspire update -
Update a specific AppHost project:
Aspire CLI aspire update --apphost './projects/apphost/orchestration.AppHost.csproj' -
Update packages in a CI/CD pipeline without interactive prompts:
Aspire CLI aspire update --yes --non-interactive -
Update packages using a specific NuGet configuration file:
Aspire CLI aspire update --nuget-config-dir './config' -
Update packages to the daily preview channel:
Aspire CLI aspire update --channel daily