dotnet-new(1)
π dotnet-new(1) π
okay so bestie, welcome to the dotnet new manual page π
this is dotnet-new straight outta the .NET documentation, and literally the whole vibe is:
dotnet new <TEMPLATE>
This article applies to: βοΈ .NET 6 SDK and later versions β¨
πΈ NAME πΈ
dotnet-new β creates a new project, configuration file, or solution based on the specified template. like, it's the "make me a thing" command. iconic. no cap. π«Ά
β¨ SYNOPSIS β¨
dotnet new <TEMPLATE> [--dry-run] [--force] [-lang|--language {"C#"|"F#"|VB}]
[-n|--name <OUTPUT_NAME>] [-f|--framework <FRAMEWORK>] [--no-update-check]
[-o|--output <OUTPUT_DIRECTORY>] [--project <PROJECT_PATH>]
[-d|--diagnostics] [--verbosity <LEVEL>] [Template options]
dotnet new -h|--help
π¦ DESCRIPTION π¦
The dotnet new command creates a .NET project or other artifacts based on a template. she's a builder, she's a maker, she's giving main character energy π
The command calls the template engine (https://github.com/dotnet/templating) to create the artifacts on disk based on the specified template and options. yes, it phones a friend. the friend is the template engine. they're besties π«Ά
Starting with the .NET 7 SDK, the dotnet new syntax has changed:
- The
--list,--search,--install, and--uninstalloptions becamelist,search,install, anduninstallsubcommands. - The
--update-applyoption became theupdatesubcommand. - To use
--update-check, use theupdatesubcommand with the--check-onlyoption.
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. π
β¨οΈ Tab completion β¨οΈ
Starting with .NET SDK 7.0.100, tab completion is available for dotnet new. It supports completion for installed template names, as well as completion for the options a selected template provides. To activate tab completion for the .NET SDK, see Enable tab completion. (yes it said this twice, she's just that excited about tab completion, and honestly? valid π
)
π¦ Implicit restore π¦
You don't have to run dotnet restore because it's run implicitly by all commands that require a restore to occur, such as dotnet new, dotnet build, dotnet run, dotnet test, dotnet publish, and dotnet pack. To disable implicit restore, use the --no-restore option.
The dotnet restore command is still useful in certain scenarios where explicitly restoring makes sense, such as continuous integration builds in Azure DevOps Services or in build systems that need to explicitly control when the restore occurs.
For information about how to manage NuGet feeds, see the dotnet restore documentation.
π ARGUMENTS π
- TEMPLATE
The template to instantiate when the command is invoked. Each template might have specific options you can pass. For more information, see Template options.
You can run dotnet new list to see a list of all installed templates. π
The search command should be used to search for templates in NuGet.org.
For a list of templates that ship with the .NET SDK, see Preinstalled templates.
π OPTIONS π
--dry-runβ Displays a summary of what would happen if the given command were run if it would result in a template creation. it's the "pretend" button, no actual files harmed π§--forceβ Forces content to be generated even if it would change existing files. This is required when the template chosen would override existing files in the output directory. bestie this one is loud β it will absolutely bulldoze over what's already there, so know what you're doing π-?|-h|--helpβ Prints out help for the command. It can be invoked for thedotnet newcommand itself or for any template. For example,dotnet new mvc --help.-lang|--language {C#|F#|VB}β The language of the template to create. The language accepted varies by the template (see defaults in the arguments section). Not valid for some templates.
Some shells interpret#as a special character. In those cases, enclose the language parameter value in quotes. For example,dotnet new console -lang "F#".
-n|--name <OUTPUT_NAME>β The name for the created output. If no name is specified, the name of the current directory is used. no name? she just borrows the folder's name. resourceful queen β¨-f|--framework <FRAMEWORK>β Specifies the target framework. It expects a target framework moniker (TFM). Examples:"net6.0","net7.0-macos". This value will be reflected in the project file.-no-update-checkβ Disables checking for template package updates when instantiating a template. Available since .NET SDK 6.0.100. When instantiating the template from a template package that was installed by usingdotnet new --install,dotnet newchecks if there is an update for the template. Starting with .NET 6, no update checks are done for .NET default templates. To update .NET default templates, install the patch version of the .NET SDK.-o|--output <OUTPUT_DIRECTORY>β Location to place the generated output. The default is the current directory.--project <PROJECT_PATH>β The project that the template is added to. This project is used for context evaluation. If not specified, the project in the current or parent directories will be used. Available since .NET SDK 7.0.100.-d|--diagnosticsβ Enables diagnostic output. Available since .NET SDK 7.0.100. π©Ί-v|--verbosity <LEVEL>β Sets the verbosity level of the command. Allowed values areq[uiet],m[inimal],n[ormal], anddiag[nostic]. Available since .NET SDK 7.0.100.
π Template options π
Each template may have additional options defined. For more information, see .NET default templates for dotnet new.
π₯ EXAMPLES π₯
- Create a C# console application project:
dotnet new console
- Create an F# console application project in the current directory:
dotnet new console --language "F#"
- Create a .NET Standard 2.0 class library project in the specified directory:
dotnet new classlib --framework "netstandard2.0" -o MyLibrary
- Create a new ASP.NET Core C# MVC project in the current directory with no authentication:
dotnet new mvc -au None
- Create a new xUnit project:
dotnet new xunit
- Create a
global.jsonin the current directory setting the SDK version to 8.0.101:
dotnet new globaljson --sdk-version 8.0.101 --roll-forward latestFeature
- Show help for the C# console application template:
dotnet new console -h
- Show help for the F# console application template:
dotnet new console --language "F#" -h
π SEE ALSO π
dotnet new listcommanddotnet new searchcommanddotnet new installcommand- .NET default templates for
dotnet new - Custom templates for
dotnet new - Create a custom template for
dotnet new
and that's the whole page bestie, you ate it up fr fr π this was dotnet-new(1) from the .NET documentation, dated 2025-10-30, and that's a wrap β go make something cute β¨ππ
π¦ where this page comes from
- alpine 3.24: dotnet-doc 10.0.303-r2 Β· MIT
- centos-stream 10: dotnet-host 11.0.0~rc.2.26504.105-0.10.el10 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- centos-stream 9: dotnet-host 11.0.0~rc.2.26504.105-0.11.el9 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 43: dotnet-host 10.0.12-1.fc43
- fedora 43: dotnet-host 11.0.0~rc.1.26425.128-0.10.fc43 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 10.0.12-1.fc44
- fedora 44: dotnet-host 10.0.4-1.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 11.0.0~rc.1.26425.128-0.12.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- nixpkgs unstable: dotnet-vmr 11.0.0-rc.3
- ubuntu noble: dotnet-host-10.0 10.0.12-0ubuntu1~24.04.1
- ubuntu questing: dotnet-host-10.0 10.0.9-0ubuntu1~25.10.1
- ubuntu resolute: dotnet-host-10.0 10.0.12-0ubuntu1~26.04.1
- ubuntu resolute: dotnet-host-10.0 10.0.5-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-10.0 10.0.12-0ubuntu2 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc1-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc3-0ubuntu1~26.10.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms