dotnet-new-update(1)

πŸ“¦
version 11.0.0~rc3 Β· 6 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

dotnet-new-update β€” updates installed template packages. no cap, that's literally the whole job bestie ✨

this article applies to: βœ”οΈ .NET 6 SDK and later versions β€” so if you're on 6 or newer, you're in the right place 🫢


✨ 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]

πŸ¦‹ DESCRIPTION πŸ¦‹

The dotnet new update command updates installed template packages. like, it goes and refreshes the template packages you already have installed. iconic behaviour, honestly πŸ’…

And the dotnet new update command with the --check-only option? That one just checks for available updates for installed template packages without applying them. it's the "window shopping" mode, the vibe check before you commit, if you will πŸŽ€

Starting with the .NET 7 SDK, the dotnet new syntax has changed:

  • The --list, --search, --install, and --uninstall options became list, search, install, and uninstall subcommands. glow-up era ✨
  • 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. not abandoned, just relocated bestie πŸ’– Separate help for each subcommand is available via the -h or --help option: dotnet new <subcommand> --help lists all supported options for the subcommand. every subcommand has its own little lore page, obsessed 🌸

Additionally, tab completion is now available for dotnet new. It supports completion for installed template names and for the options a selected template provides. literally so convenient 😭 To activate tab completion for the .NET SDK, see Enable tab completion.

Examples of the old syntax: - Show help for the update subcommand. - Check for updates for installed template packages: dotnetcli dotnet new --update-check - Update installed template packages: dotnetcli dotnet new --update-apply

πŸ‘‘ OPTIONS πŸ‘‘

  • --interactive β€” Allows the command to stop and wait for user input or action. For example, to complete authentication. it will literally just sit there and wait for you, patiently, like a bestie holding your bag 🫢 Available since .NET 5.0 SDK.
  • --add-source|nuget-source <SOURCE> β€” By default, dotnet new install uses the hierarchy of NuGet configuration files from the current directory 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 dotnet nuget list source. For more information, 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. the "peek but don't touch" option, we respect it πŸ™ˆ
  • -d|--diagnostics β€” Enables diagnostic output. Available since .NET SDK 7.0.100. when you need the tea β˜•πŸ”
  • -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 diag[nostic]. Available since .NET SDK 7.0.100. pick your volume bestie πŸ“’

🌈 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

πŸ’œ SEE ALSO πŸ’œ

  • dotnet new command
  • dotnet new search command
  • dotnet new install command
  • Custom templates for dotnet new

okay that's the whole page bestie, you ate πŸ’…βœ¨

this was .NET Documentation's dotnet-new-update(1), dated 2025-10-30 β€” mwah, go update ur templates, ily πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from