You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-new-sdk-templates.md
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ title: .NET default templates for dotnet new
3
3
description: The information about dotnet new templates shipped with dotnet SDK.
4
4
ms.custom: updateeachrelease
5
5
no-loc: [Blazor, WebAssembly]
6
-
ms.date: 02/21/2024
6
+
ms.date: 08/29/2025
7
7
---
8
-
# .NET default templates for dotnet new
8
+
# Default templates for `dotnet new`
9
9
10
10
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:
11
11
@@ -19,7 +19,31 @@ dotnet new list
19
19
20
20
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`.
21
21
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#`.
22
-
The templates that ship with the .NET SDK have the following additional options:
22
+
The templates that ship with the .NET SDK have additional options that are described in the following sections.
23
+
24
+
## `buildprops`
25
+
26
+
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).
27
+
28
+
-**`--inherit`**
29
+
30
+
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.
31
+
32
+
-**`--use-artifacts`**
33
+
34
+
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).
35
+
36
+
***
37
+
38
+
## `buildtargets`
39
+
40
+
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).
41
+
42
+
-**`--inherit`**
43
+
44
+
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.
45
+
46
+
***
23
47
24
48
## `console`
25
49
@@ -901,6 +925,15 @@ API Controller with or without read/write actions.
901
925
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.
902
926
For more information, see [global-json](global-json.md#rollforward).
903
927
928
+
## `sln`
929
+
930
+
Creates an empty solution file containing no projects.
931
+
932
+
> [!NOTE]
933
+
> 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`.
934
+
935
+
***
936
+
904
937
## `editorconfig`
905
938
906
939
Creates an *.editorconfig* file for configuring code style preferences.
0 commit comments