1(1)                                  .NET                                  (1)
2
3
4

dotnet new –install option

6       This article applies to: ✔️ .NET Core 2.0 SDK and later versions
7

NAME

9       dotnet new --install - installs a template package.
10

SYNOPSIS

12              dotnet new --install <PATH|NUGET_ID>  [--interactive] [--nuget-source <SOURCE>]
13

DESCRIPTION

15       The  dotnet  new --install command installs a template package from the
16       PATH or NUGET_ID provided.  If you want to install a prerelease version
17       of  a  template  package,  specify  the version in the format <package-
18       name>::<package-version>.  By default, dotnet new passes * for the ver‐
19       sion, which represents the latest stable package version.  For more in‐
20       formation, see the Examples section.
21
22       If a version of the template was already installed when  you  run  this
23       command,  the  template will be updated to the specified version, or to
24       the latest stable version if no version was specified.  For information
25       on creating custom templates, see Custom templates for dotnet new.
26

OPTIONS

28--interactive
29
30         Allows  the  command  to stop and wait for user input or action.  For
31         example, to complete authentication.  Available since .NET 5.0 SDK.
32
33--nuget-source <SOURCE>
34
35         By default, dotnet new --install uses the hierarchy of NuGet configu‐
36         ration files from the current directory to determine the NuGet source
37         the package can be installed from.  If --nuget-source  is  specified,
38         the source will be added to the list of sources to be checked.
39         To  check the configured sources for the current directory use dotnet
40         nuget list source.  For more information, see Common NuGet Configura‐
41         tions
42

EXAMPLES

44       • Install the latest version of SPA templates for ASP.NET Core:
45
46                dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates
47
48       • Install version 2.0 of the SPA templates for ASP.NET Core:
49
50                dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0
51
52       • Install version 2.0 of the SPA templates for ASP.NET Core from a cus‐
53         tom NuGet source using interactive mode:
54
55                dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0 --nuget-source "https://api.my-custom-nuget.com/v3/index.json" --interactive
56
57   See also
58       • dotnet new command
59
60       • dotnet new –search option
61
62       • Custom templates for dotnet new
63
64
65
66                                                                           (1)
Impressum