dotnet-new-install(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

πŸ’– dotnet-new-install β€” a whole manual page, but make it make sense πŸ’–

okay bestie, so this is the dotnet-new-install(1) page from the .NET Documentation, and it's literally the one that teaches you how to install template packages. no cap.

This article applies to: βœ”οΈ .NET Core 3.1 SDK and later versions

✨ NAME ✨

dotnet-new-install β€” installs a template package. that's it. that's the whole job. πŸ’…


🌸 SYNOPSIS 🌸

dotnet new install <PATH|NUGET_ID>  [--interactive] [--add-source|--nuget-source <SOURCE>] [--force]
    [-d|--diagnostics] [--verbosity <LEVEL>] [-h|--help]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the dotnet new install command installs a template package from the PATH or NUGET_ID you hand it. simple queen behavior. πŸŽ€

if you wanna install a specific version or a prerelease version of a template package, you drop the version in like this: <package-name>::<package-version>. by default, dotnet new passes * for the version, and * literally means "gimme the latest stable package version, periodt". more deets in the Examples section, iykyk.

if a version of the template package was already installed when you run this command, the template package gets updated to the specified version. and if you didn't specify a version, it updates to the latest stable version. okay so here's the glow-up: starting with .NET SDK 6.0.100, if the argument specifies the version and that version of the NuGet package is already installed, it won't be reinstalled. if the argument is a PATH and it's already installed, it won't be reinstalled either. no duplicate installs, we don't do that here. πŸ’€

prior to .NET SDK 6.0.100, template packages were managed individually for each .NET SDK version, patch versions included. like, for example, if you install the template package using dotnet new --install in .NET SDK 5.0.100, it will be installed only for .NET SDK 5.0.100. templates from the package won't be available in other .NET SDK versions installed on your machine. rip. 😭

starting with .NET SDK 6.0.100 though?? installed template packages are available in later .NET SDK versions installed on your machine. a template package installed in .NET SDK 6.0.100 will also be available in .NET SDK 6.0.101, .NET SDK 6.0.200, and so on. however (and this is the important part), these template packages won't be available in .NET SDK versions prior to .NET SDK 6.0.100. to use a template package installed in .NET SDK 6.0.100 or later in earlier .NET SDK versions, you need to install it using dotnet new install in that .NET SDK version. okay? okay. 🫢

starting with the .NET 7 SDK, the dotnet new syntax changed. here's the tea:

  • 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: dotnet new <subcommand> --help lists all supported options for the subcommand. iconic.

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 old syntax:

  • Install the latest version of Azure web jobs project template package:
dotnetcli
  dotnet new --install Microsoft.Azure.WebJobs.ProjectTemplates
[!WARNING] Templates can run MSBuild code when triggered, don't install or run untrusted .NET templates. bestie. please. 🚨 this is the one where you actually listen to me.

πŸŽ€ ARGUMENTS πŸŽ€

  • <PATH|NUGET_ID>

the folder on the file system, or the NuGet package identifier, to install the template package from. dotnet new attempts to install the NuGet package from the NuGet sources available for the current working directory and the sources specified via the --add-source option. if you wanna install a specific version or prerelease version of a template package from a NuGet source, specify the version in the format <package-name>::<package-version>. slay. ✨


πŸ’… OPTIONS πŸ’…

  • --add-source|--nuget-source <SOURCE> β€” by default, dotnet new install uses the hierarchy of NuGet configuration files from the current directory to figure out which NuGet source the package can be installed from. if --nuget-source is specified, the source gets 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 info, see Common NuGet Configurations.
following NuGet's Https Everywhere initiative (https://devblogs.microsoft.com/nuget/https-everywhere/), dotnet new is phasing out http feeds. if an http feed is passed, it isn't queried for packages and a warning is displayed. the --force option can be used to override this behavior if necessary. ⚠️
  • -d|--diagnostics β€” enables diagnostic output. available since .NET SDK 7.0.100.
  • --force β€” allows installing template packages from the specified sources even if they would override a template package from another source. available since .NET SDK 7.0.100. use responsibly bestie 😭
  • -h|--help β€” prints out help for the install command. available since .NET SDK 7.0.100.
  • --interactive β€” allows the command to stop and wait for user input or action. for example, to complete authentication. available since .NET 5.0 SDK.
  • -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.

🌈 EXAMPLES 🌈

  1. Install the latest version of SPA templates for ASP.NET Core:
dotnet new install Microsoft.DotNet.Web.Spa.ProjectTemplates
  1. Install version 2.0 of the SPA templates for ASP.NET Core:
dotnet new install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0
  1. Install version 2.0 of the SPA templates for ASP.NET Core from a custom NuGet source using interactive mode:
dotnet new install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0 --add-source "https://api.my-custom-nuget.com/v3/index.json" --interactive

πŸ‘‘ SEE ALSO πŸ‘‘

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

and that's the whole page, bestie!! go forth and install templates responsibly πŸ’–

source + version: this is the .NET Documentation dotnet-new-install(1) page, dated 2025-10-30. that's the receipt. 🧾✨

mwah, love u, see u in the next manpage πŸ«ΆπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from