Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions docs/core/tools/dotnet-new-sdk-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: .NET default templates for dotnet new
description: The information about dotnet new templates shipped with dotnet SDK.
ms.custom: updateeachrelease
no-loc: [Blazor, WebAssembly]
ms.date: 02/21/2024
ms.date: 08/29/2025
---
# .NET default templates for dotnet new
# Default templates for `dotnet new`

When you install the [.NET SDK](https://dotnet.microsoft.com/download), you receive over a dozen built-in templates for creating projects and files, including console apps, class libraries, unit test projects, ASP.NET Core apps (including [Angular](https://angular.io/) and [React](https://reactjs.org/) projects), and configuration files. To list the built-in templates, run the `dotnet new list` command:

Expand All @@ -19,7 +19,31 @@ dotnet new list

Each template may have additional options available. To show the additional options available for the template use the `--help` option with the template name argument, for example: `dotnet new console --help`.
In case the template supports multiple languages, this command will show help for the template in the default language. By combining it with the `--language` option, you can see the help for other languages: `dotnet new console --help --language F#`.
The templates that ship with the .NET SDK have the following additional options:
The templates that ship with the .NET SDK have additional options that are described in the following sections.

## `buildprops`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all of these sections are really about the options for each template, I feel like each template heading should be an H3, not an H2, to make them subheadings of ## Template options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would mean that there is a single H2 in the entire article and that the TOC on the right-side is useless. Considering each section here is a template itself, I think it makes sense to keep them as H2.


Creates a *Directory.Build.props* file for customizing MSBuild properties for an entire folder tree. For more information, see [Customize your build](/visualstudio/msbuild/customize-your-build).

- **`--inherit`**

If specified, adds an Import element for the closest *Directory.Build.props* file in the parent directory hierarchy. By default, *Directory.Build.props* files don't inherit from parent directories, so enabling this option allows you to build up a hierarchy of customizations folder-by-folder.

- **`--use-artifacts`**

If specified, adds a property to enable the artifacts output layout. This is a common pattern for projects that produce build artifacts, such as NuGet packages, that are placed in a common folder structure. For more information, see [Artifacts output layout](../sdk/artifacts-output.md).

***

## `buildtargets`

Creates a *Directory.Build.targets* file for customizing MSBuild targets and tasks for an entire folder tree. For more information, see [Customize your build](/visualstudio/msbuild/customize-your-build).

- **`--inherit`**

If specified, adds an Import element for the closest *Directory.Build.targets* file in the parent directory hierarchy. By default, *Directory.Build.targets* files don't inherit from parent directories, so enabling this option allows you to build up a hierarchy of customizations folder-by-folder.

***

## `console`

Expand Down Expand Up @@ -901,6 +925,15 @@ API Controller with or without read/write actions.
The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version.
For more information, see [global-json](global-json.md#rollforward).

## `sln`

Creates an empty solution file containing no projects.

> [!NOTE]
> In .NET SDK 9.0.200 and later, this template supports a `--format` option to choose between `sln` and `slnx` formats. Starting with .NET 10, the default format is `slnx`.

***

## `editorconfig`

Creates an *.editorconfig* file for configuring code style preferences.
Expand Down
4 changes: 3 additions & 1 deletion includes/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ The following table shows the templates that come pre-installed with the .NET SD
| NuGet Config | `nugetconfig` | | Config | 1.0 |
| Dotnet local tool manifest file | `tool-manifest` | | Config | 3.0 |
| Web Config | `webconfig` | | Config | 1.0 |
| Solution File | `sln` | | Solution | 1.0 |
| Directory.Build.props file | [`buildprops`](../docs/core/tools/dotnet-new-sdk-templates.md#buildprops) | | Config | 8.0.100 |
| Directory.Build.targets file | [`buildtargets`](../docs/core/tools/dotnet-new-sdk-templates.md#buildtargets) | | Config | 8.0.100 |
| Solution File | [`sln`](../docs/core/tools/dotnet-new-sdk-templates.md#sln) | | Solution | 1.0 |
| Protocol Buffer File | [`proto`](../docs/core/tools/dotnet-new-sdk-templates.md#namespace) | | Web/gRPC | 3.0 |
| EditorConfig file | [`editorconfig`](../docs/core/tools/dotnet-new-sdk-templates.md#editorconfig) | | Config | 6.0 |

Expand Down