Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This article applies to: ✔️ .NET Core 3.1 SDK and later versions
dotnet new update
- updates installed template packages.
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]
The dotnet new update
command updates installed template packages.
The dotnet new update
command with --check-only
option checks for available updates for installed template packages without applying them.
Note
Starting with the .NET 7 SDK, the dotnet new
syntax has changed:
--list
, --search
, --install
, and --uninstall
options became list
, search
, install
, and uninstall
subcommands.--update-apply
option became the update
subcommand.--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: dotnet new <subcommand> --help
lists all supported options for the subcommand.
Additionally, tab completion is now available for dotnet new
. It supports completion for installed template 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
subcommand.
Check for updates for installed template packages:
dotnet new --update-check
Update installed template packages:
dotnet new --update-apply
--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, 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.
-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 diag[nostic]
. Available since .NET SDK 7.0.100.
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
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now