This article applies to: ✔️ .NET Core 3.1 SDK and later versions
Contents
Description
The dotnetnewupdate command updates installed template packages. The dotnetnewupdate command with
--check-only option checks for available updates for installed template packages without applying them.
Starting with the .NET 7 SDK, the dotnetnew syntax has changed:
• The --list, --search, --install, and --uninstall options became list, search, install, and uninstall
subcommands.
• The --update-apply option became the update subcommand.
• To use --update-check, use the update subcommand with the --check-only option.
Other options that were available before are still available to use with their respective subcommands.
Separate help for each subcommand is available via the -h or --help option: dotnetnew<subcommand>--help lists all supported options for the subcommand.
Additionally, tab completion is now available for dotnetnew. It supports completion for installed tem‐
plate names and for the options a selected template provides. To activate tab completion for the .NET
SDK, see Enable tab completion. > > Examples of the old syntax: > > - Show help for the update subcom‐
mand. > > - Check for updates for installed template packages: > > dotnetcli>dotnetnew--update-check> > > - Update installed template packages: > > dotnetcli>dotnetnew--update-apply>Dotnet New Update
Thisarticleappliesto: ✔️ .NET Core 3.1 SDK and later versions
Examples
• Updates the installed template packages using NuGet configuration for the current directory:
dotnet new update
• Updates the installed template packages also checking a custom NuGet source using interactive mode:
dotnet new update --add-source "https://api.my-custom-nuget.com/v3/index.json" --interactive
Name
dotnet-new-update - updates installed template packages.
Options
• --interactive
Allows the command to stop and wait for user input or action. For example, to complete authentication.
Available since .NET 5.0 SDK.
• --add-source|nuget-source<SOURCE>
By default, dotnetnewinstall uses the hierarchy of NuGet configuration files from the current direc‐
tory to determine the NuGet source the package can be installed from. If --nuget-source is specified,
the source will be added to the list of sources to be checked.
To check the configured sources for the current directory use dotnetnugetlistsource. For more in‐
formation, see Common NuGet Configurations. Available since .NET SDK 7.0.100.
• --check-only|--dry-run
Only checks for updates and displays the template packages to be updated, without applying any updates.
• -d|--diagnostics
Enables diagnostic output. Available since .NET SDK 7.0.100.
• -h|--help
Prints out help for the update command. Available since .NET SDK 7.0.100.
• -v|--verbosity<LEVEL>
Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], and di‐ag[nostic]. Available since .NET SDK 7.0.100.
See Also
• dotnet new command
• dotnet new search command
• dotnet new install command
• Custom templates for dotnet new
2024-10-02 dotnet-new-update(1)
Synopsis
dotnet new update [--interactive] [--add-source|--nuget-source <SOURCE>]
[-d|--diagnostics] [--verbosity <LEVEL>] [-h|--help]
dotnet new update --check-only|--dry-run [--interactive] [--add-source|--nuget-source <SOURCE>]
[-d|--diagnostics] [--verbosity <LEVEL>] [-h|--help]
