dotnet-new-sdk-templates(7)

πŸ“¦
version 11.0.0~rc.2.26504.105 Β· 2 versions
  • 11.0.0~rc.2.26504.105 Β· centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable (latest)
  • 9.0.8 Β· fedora 43
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable

πŸ’– dotnet-new-sdk-templates πŸ’–

welcome to the dotnet-new-sdk-templates(7) glow-up, bestie ✨ this is the page that tells you about every single template that's just already there the moment you install the .NET SDK. no extra downloads, no hunting around, just vibes and scaffolding. let's get into it 🫢


✨ NAME ✨

dotnet-new-sdk-templates β€” the default templates for dotnet-new 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so when you install the .NET SDK (https://dotnet.microsoft.com/download), you don't just get a compiler, you get over a dozen built-in templates for creating projects and files. we're talking 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. it's giving starter pack, fr fr.

to list the built-in templates, run the dotnet new list command:

dotnet new list

πŸŽ€ Template options

the templates that ship with the .NET SDK has template-specific options. to show the additional options available for the template, use the --help option with the template name argument, for example: dotnet new console --help. the template-specific sections in this article also describe the options too, so you're covered either way πŸ’…

if the template supports multiple programming languages, the --help option will show help for the template in the default language. but bestie, you can combine it with the --language option to see the help for other languages: dotnet new console --help --language F#. iconic behaviour honestly.


πŸ‘‘ Preinstalled templates

okay so here's the full roster of templates that come preinstalled with the .NET SDK. the default language for the template is shown inside brackets. and to see any template-specific options, just tap the short name link β€” main character energy, each one has its own little section.

  • ASP.NET Core API β€” short name webapiaot β€” language [C#] β€” tags Web/Web API/API/Service β€” introduced 8.0
  • ASP.NET Core API controller β€” short name apicontroller β€” language [C#] β€” tags Web/ASP.NET β€” introduced 8.0
  • ASP.NET Core Empty β€” short name web β€” language [C#], F# β€” tags Web/Empty β€” introduced 1.0
  • ASP.NET Core Web API β€” short name webapi β€” language [C#], F# β€” tags Web/Web API/API/Service/WebAPI β€” introduced 1.0
  • ASP.NET Core Web App (Model-View-Controller) β€” short name mvc β€” language [C#], F# β€” tags Web/MVC β€” introduced 1.0
  • ASP.NET Core Web App β€” short name webapp, razor β€” language [C#] β€” tags Web/MVC/Razor Pages β€” introduced 2.2, 2.0
  • ASP.NET Core gRPC Service β€” short name grpc β€” language [C#] β€” tags Web/gRPC β€” introduced 3.0
  • Blazor Web App β€” short name blazor β€” language [C#] β€” tags Web/Blazor β€” introduced 8.0.100
  • Blazor WebAssembly Standalone App β€” short name blazorwasm β€” language [C#] β€” tags Web/Blazor/WebAssembly/PWA β€” introduced 3.1.300
  • Class library β€” short name classlib β€” language [C#], F#, VB β€” tags Common/Library β€” introduced 1.0
  • Console Application β€” short name console β€” language [C#], F#, VB β€” tags Common/Console β€” introduced 1.0
  • Directory.Build.props file β€” short name buildprops β€” tags Config β€” introduced 8.0.100
  • Directory.Build.targets file β€” short name buildtargets β€” tags Config β€” introduced 8.0.100
  • Dotnet local tool manifest file β€” short name tool-manifest β€” tags Config β€” introduced 3.0
  • EditorConfig file β€” short name editorconfig β€” tags Config β€” introduced 6.0
  • global.json file β€” short name globaljson β€” tags Config β€” introduced 2.0
  • MSTest Test Class β€” short name mstest-class β€” language [C#], F#, VB β€” tags Test/MSTest β€” introduced 1.0
  • MSTest Test Project β€” short name mstest β€” language [C#], F#, VB β€” tags Test/MSTest β€” introduced 1.0
  • NUnit 3 Test Item β€” short name nunit-test β€” language [C#], F#, VB β€” tags Test/NUnit β€” introduced 2.2
  • NUnit 3 Test Project β€” short name nunit β€” language [C#], F#, VB β€” tags Test/NUnit β€” introduced 2.1.400
  • NuGet Config β€” short name nugetconfig β€” tags Config β€” introduced 1.0
  • Protocol Buffer File β€” short name proto β€” tags Web/gRPC β€” introduced 3.0
  • Razor Class Library β€” short name razorclasslib β€” language [C#] β€” tags Web/Razor/Library/Razor Class Library β€” introduced 2.1
  • Razor Component β€” short name razorcomponent β€” language [C#] β€” tags Web/ASP.NET β€” introduced 3.0
  • Razor Page β€” short name page β€” language [C#] β€” tags Web/ASP.NET β€” introduced 2.0
  • Solution File β€” short name sln β€” tags Solution β€” introduced 1.0
  • Web Config β€” short name webconfig β€” tags Config β€” introduced 1.0
  • Windows Forms (WinForms) Application β€” short name winforms β€” language [C#], VB β€” tags Common/WinForms β€” introduced 3.0 (5.0 for VB)
  • Windows Forms (WinForms) Class library β€” short name winformslib β€” language [C#], VB β€” tags Common/WinForms β€” introduced 3.0 (5.0 for VB)
  • Worker Service β€” short name worker β€” language [C#] β€” tags Common/Worker/Web β€” introduced 3.0
  • WPF Application β€” short name wpf β€” language [C#], VB β€” tags Common/WPF β€” introduced 3.0 (5.0 for VB)
  • WPF Class library β€” short name wpflib β€” language [C#], VB β€” tags Common/WPF β€” introduced 3.0 (5.0 for VB)
  • WPF Custom Control Library β€” short name wpfcustomcontrollib β€” language [C#], VB β€” tags Common/WPF β€” introduced 3.0 (5.0 for VB)
  • WPF User Control Library β€” short name wpfusercontrollib β€” language [C#], VB β€” tags Common/WPF β€” introduced 3.0 (5.0 for VB)
  • xUnit Test Project β€” short name xunit β€” language [C#], F#, VB β€” tags Test/xUnit β€” introduced 1.0
  • MVC ViewImports β€” short name viewimports β€” language [C#] β€” tags Web/ASP.NET β€” introduced 2.0
  • MVC ViewStart β€” short name viewstart β€” language [C#] β€” tags Web/ASP.NET β€” introduced 2.0

🧚 buildprops

creates a Directory.Build.props file for customizing MSBuild properties for an entire folder tree. for more information, see Customize your build. lowkey a whole vibe for keeping your repo organized 🫢

  • --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. it's giving generational wealth for your config, no cap.
  • --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. obsessed with a tidy output folder tbh ✨

πŸŽ€ 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.

  • --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. same energy as buildprops but for targets, slay.

πŸ’œ console

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

the following table lists the default values according to the SDK version you're using:

  • SDK version 9.0 β†’ default value net9.0
  • SDK version 8.0 β†’ default value net8.0
  • SDK version 7.0 β†’ default value net7.0

the ability to create a project for an earlier TFM depends on having that version of the SDK installed. for example, if you have only the .NET 9 SDK installed, then the only value available for --framework is net9.0. if, for example, you install the .NET 8 SDK, the value net8.0 becomes available for --framework. so by specifying --framework net8.0 you can target .NET 8 even while running dotnet new in the .NET 9 SDK. the way that works is genuinely so neat 😭

alternatively, to create a project that targets a framework earlier than the SDK that you're using, you might be able to do it by installing the NuGet package for the template. Common (https://www.nuget.org/packages?q=Microsoft.DotNet.Common.ProjectTemplates), web (https://www.nuget.org/packages?q=Microsoft.DotNet.Web.ProjectTemplates), and SPA (https://www.nuget.org/packages?q=Microsoft.DotNet.Web.Spa.ProjectTemplates) project types use different packages per target framework moniker (TFM). for example, to create a console project that targets netcoreapp1.0, run dotnet new install on Microsoft.DotNet.Common.ProjectTemplates.1.x. iykyk πŸ’…

  • --langVersion <VERSION_NUMBER> β€” sets the LangVersion property in the created project file. for example, use --langVersion 7.3 to use C# 7.3. not supported for F#.

for a list of default C# versions, see Defaults.

  • --no-restore β€” if specified, doesn't execute an implicit restore during project creation. sometimes you just don't wanna, and that's valid πŸ™ˆ
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. available since .NET SDK 6.0.300. default value: false. available only for C#.

πŸ“ classlib

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target. values: net9.0, net8.0, or net7.0 to create a .NET Class Library, or netstandard2.1 or netstandard2.0 to create a .NET Standard Class Library. the default value for .NET SDK 9.0.x is net9.0.

to create a project that targets a framework earlier than the SDK that you're using, see --framework for console projects earlier in this article. ⬆️ go look, bestie

  • --langVersion <VERSION_NUMBER> β€” sets the LangVersion property in the created project file. for example, use --langVersion 7.3 to use C# 7.3. not supported for F#.

for a list of default C# versions, see Defaults.

  • --no-restore β€” doesn't execute an implicit restore during project creation.

🌈 wpf, wpflib, wpfcustomcontrollib, wpfusercontrollib

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target. for the .NET 9 SDK, the default value is net9.0.
  • --langVersion <VERSION_NUMBER> β€” sets the LangVersion property in the created project file. for example, use --langVersion 7.3 to use C# 7.3.

for a list of default C# versions, see Defaults.

  • --no-restore β€” doesn't execute an implicit restore during project creation.

πŸ¦‹ winforms, winformslib

  • --langVersion <VERSION_NUMBER> β€” sets the LangVersion property in the created project file. for example, use --langVersion 7.3 to use C# 7.3.

Wanna know what the default C# versions are? Skim over to Defaults, bestie, it's all there. πŸ’œ

  • --no-restore β€” doesn't run an implicit restore</b> while the project is being created. Like, it just skips that step entirely. πŸ™ˆ

🧡 worker, grpc 🧡

  • -f, --framework <FRAMEWORK> β€” tells it which framework to target. For the .NET 9 SDK, the default is net9.0. ✨

If you wanna build a project that targets a framework older than the SDK you're running, go look at --framework for console projects earlier in this article. It's giving "scroll up, babe". ⬆️

  • --exclude-launch-settings β€” yeets launchSettings.json out of the generated template. Gone. Not invited. πŸ’…
  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • --use-program-main β€” if you pass this, you get an explicit Program class and Main method instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false. πŸ‘‘

πŸ§ͺ mstest πŸ§ͺ

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target. 🎯

Here's the vibe β€” default values by SDK version:

  • SDK 9.0 β†’ net9.0
  • SDK 8.0 β†’ net8.0
  • SDK 7.0 β†’ net7.0

And the way you can build for an earlier TFM at all depends on whether you have that version of the SDK installed. Example: if all you've got is the .NET 9 SDK, then net9.0 is literally the only value available for --framework. But install the .NET 8 SDK, for instance, and net8.0 becomes available for --framework. So by saying --framework net8.0 you can target .NET 8 even while running dotnet new in the .NET 9 SDK. No cap. πŸ¦‹

  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • --sdk β€” use the MSTest.Sdk project style. 🌸
  • --test-runner <TEST_RUNNER> β€” the runner/platform for the test project. Possible values:
    • VSTest β€” VSTest platform (Default).
    • MSTest β€” Microsoft.Testing.Platform.
  • --coverage-tool <COVERAGE_TOOL> β€” the coverage tool to use for the test project. Possible values:
    • Microsoft.CodeCoverage β€” Microsoft Code Coverage (Default).
    • coverlet β€” coverlet coverage tool.
  • --extensions-profile <EXTENSIONS_PROFILE> β€” the SDK extensions profile when using Microsoft.Testing.Platform. Possible values:
    • Default β€” Default extensions profile (Default).
    • None β€” no extensions are enabled.
    • AllMicrosoft β€” enable all extensions shipped by Microsoft (including extensions with a restrictive license). ⚠️ yeah, read that again, restrictive license and all.
  • --fixture <FIXTURE> β€” the fixture kinds to include in the test project. Possible values:
    • None β€” no fixture methods.
    • AssemblyInitialize β€” AssemblyInitialize fixture method.
    • AssemblyCleanup β€” AssemblyCleanup fixture method.
    • ClassInitialize β€” ClassInitialize fixture method.
    • ClassCleanup β€” ClassCleanup fixture method.
    • TestInitialize β€” TestInitialize fixture method.
    • TestCleanup β€” TestCleanup fixture method.

Where multiple values are allowed. Stack 'em, bestie. πŸ’…

  • -p, --enable-pack β€” enables packaging for the project using dotnet pack. πŸ“¦

πŸŽ€ mstest-class πŸŽ€

  • --fixture <FIXTURE> β€” the fixture kinds to include in the test project. Possible values:
    • None β€” no fixture methods.
    • AssemblyInitialize β€” AssemblyInitialize fixture method.
    • AssemblyCleanup β€” AssemblyCleanup fixture method.
    • ClassInitialize β€” ClassInitialize fixture method.
    • ClassCleanup β€” ClassCleanup fixture method.
    • TestInitialize β€” TestInitialize fixture method.
    • TestCleanup β€” TestCleanup fixture method.

Where multiple values are allowed. ✨


πŸ¦‹ xunit πŸ¦‹

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Defaults by SDK version, bestie:

  • SDK 9.0 β†’ net9.0
  • SDK 8.0 β†’ net8.0
  • SDK 7.0 β†’ net7.0

The ability to create a project for an earlier TFM depends on having that version of the SDK installed. Like, if you've only got the .NET 9 SDK installed, then the only value available for --framework is net9.0. If you install, say, the .NET 8 SDK, then net8.0 becomes available for --framework. So specifying --framework net8.0 lets you target .NET 8 even while running dotnet new in the .NET 9 SDK. Slay. 🌈

  • -p, --enable-pack β€” enables packaging for the project using dotnet pack.
  • --no-restore β€” doesn't execute an implicit restore during project creation.

🌸 nunit 🌸

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Defaults by SDK version, again:

  • SDK 9.0 β†’ net9.0
  • SDK 8.0 β†’ net8.0
  • SDK 7.0 β†’ net7.0

The ability to create a project for an earlier TFM depends on having that version of the SDK installed. If you have only the .NET 9 SDK installed, then the only value available for --framework is net9.0. Install the .NET 8 SDK, for example, and net8.0 becomes available for --framework. So by specifying --framework net8.0 you can target .NET 8 even while running dotnet new in the .NET 9 SDK. Periodt. πŸ’œ

  • -p, --enable-pack β€” enables packaging for the project using dotnet pack.
  • --no-restore β€” doesn't execute an implicit restore during project creation.

πŸ“„ page πŸ“„

  • -na, --namespace <NAMESPACE_NAME> β€” the namespace for the generated code. Default value is MyApp.Namespace. πŸŽ€
  • -np, --no-pagemodel β€” creates the page without a PageModel. No model, just vibes. πŸ™ˆ

🧚 viewimports, proto 🧚

  • -na, --namespace <NAMESPACE_NAME> β€” the namespace for the generated code. Default value is MyApp.Namespace. ✨

πŸ’– blazor πŸ’–

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Heads up: this template is available for .NET 8 or later. 🫢

  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated app. Bye bestie. πŸ‘‹
  • -int, --interactivity <None|Server|Webassembly|Auto > β€” specifies which interactive render mode to use for interactive components. Possible values:
    • None β€” no interactivity (static server-side rendering only).
    • Server β€” (Default) runs the app on the server with interactive server-side rendering.
    • WebAssembly β€” runs the app using client-side rendering in the browser with WebAssembly.
    • Auto β€” uses interactive server-side rendering while downloading the Blazor bundle and activating the Blazor runtime on the client, then uses client-side rendering with WebAssembly. It's giving "best of both worlds". ⭐
  • --empty β€” omits the sample pages and styling that demonstrate basic usage patterns. Blank canvas energy. 🎨
  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use. Possible values:
    • None β€” no authentication (Default).
    • Individual β€” individual authentication.
  • -uld, --use-local-db β€” specifies that LocalDB should be used instead of SQLite. Only applies to Individual authentication. πŸ”₯
  • -ai, --all-interactive β€” makes every page interactive by applying an interactive render mode at the top level. If false, pages use static server-side rendering by default and can be marked interactive on a per-page or per-component basis. This option is only effective if the -i|--interactivity option isn't set to None. Main character energy for every single page, honestly. πŸ‘‘
  • --no-https β€” turns off HTTPS. This option only applies if Individual isn't chosen for the -au|--auth option.
  • --use-program-main β€” if specified, an explicit Program class and Main method is generated instead of top-level statements.

🌐 web 🌐

  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template.
  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Defaults by SDK version, one more time for the people in the back:

  • SDK 9.0 β†’ net9.0
  • SDK 8.0 β†’ net8.0
  • SDK 7.0 β†’ net7.0

To create a project that targets a framework earlier than the SDK you're using, see --framework for console projects earlier in this article. ⬆️

  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • --no-https β€” turns off HTTPS. πŸ”“
  • --kestrelHttpPort β€” port number to use for the HTTP endpoint in launchSettings.json.
  • --kestrelHttpsPort β€” port number to use for the HTTPS endpoint in launchSettings.json. This option is not applicable when the parameter no-https is used (but no-https is ignored when an individual or organizational authentication setting is chosen for --auth). Yeah it's a little messy, iykyk. πŸ’€
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

🎬 mvc, webapp 🎬

  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use. Possible values:
    • None β€” no authentication (Default).
    • Individual β€” individual authentication.
    • IndividualB2C β€” individual authentication with Azure AD B2C.
    • SingleOrg β€” organizational authentication for a single tenant. Entra External ID tenants also use SingleOrg.
    • MultiOrg β€” organizational authentication for multiple tenants.
    • Windows β€” Windows authentication.
  • --aad-b2c-instance <INSTANCE> β€” the Azure Active Directory B2C instance to connect to. Use with IndividualB2C authentication. Default value is https://login.microsoftonline.com/tfp/. πŸ¦‹
  • -ssp, --susi-policy-id <ID> β€” the sign-in and sign-up policy ID for this project. Use with IndividualB2C authentication.
  • -rp, --reset-password-policy-id <ID> β€” the reset password policy ID for this project. Use with IndividualB2C authentication.
  • -ep, --edit-profile-policy-id <ID> β€” the edit profile policy ID for this project. Use with IndividualB2C authentication. ✨
  • --aad-instance <INSTANCE> β€” the Azure Active Directory instance you're connecting to. Use it with SingleOrg or MultiOrg authentication. Default is https://login.microsoftonline.com/. πŸ’«
  • --client-id <ID> β€” the Client ID for this project. Use it with IndividualB2C, SingleOrg, or MultiOrg authentication. Default is 11111111-1111-1111-11111111111111111.
  • --domain <DOMAIN> β€” the domain for the directory tenant. Use it with SingleOrg or IndividualB2C authentication. Default is qualified.domain.name.
  • --tenant-id <ID> β€” the TenantId ID of the directory to connect to. Use it with SingleOrg authentication. Default is 22222222-2222-2222-2222-222222222222.
  • --callback-path <PATH> β€” the request path within the application's base path of the redirect URI. Use it with SingleOrg or IndividualB2C authentication. Default is /signin-oidc.
  • -r, --org-read-access β€” lets this app have read-access to the directory. Only applies to SingleOrg or MultiOrg authentication. πŸ‘€
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template. bye bestie 🫢
  • --no-https β€” turns off HTTPS. This one only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't being used.
  • -uld, --use-local-db β€” says LocalDB should be used instead of SQLite. Only applies to Individual or IndividualB2C authentication.
  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

The default values depend on which SDK version you're on, and here's the tea:

  • SDK version 9.0 β†’ default value net9.0
  • SDK version 8.0 β†’ default value net8.0
  • SDK version 7.0 β†’ default value net7.0

Wanna make a project that targets a framework earlier than the SDK you're using? Go check --framework for console projects earlier in this article. ✨

  • --no-restore β€” doesn't run an implicit restore during project creation.
  • --use-browserlink β€” includes BrowserLink in the project.
  • -rrc, --razor-runtime-compilation β€” decides whether the project is configured to use Razor runtime compilation in Debug builds.
  • --kestrelHttpPort β€” port number to use for the HTTP endpoint in launchSettings.json.
  • --kestrelHttpsPort β€” port number to use for the HTTPS endpoint in launchSettings.json. This one is not applicable when the parameter no-https is used (but heads up: no-https gets ignored when an individual or organizational authentication setting is chosen for --auth).
  • --use-program-main β€” if you specify this, an explicit Program class and Main method get used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

razorclasslib πŸŽ€

  • --no-restore β€” doesn't run an implicit restore during project creation.
  • -s, --support-pages-and-views β€” supports adding traditional Razor pages and Views in addition to components to this library.

webapiaot πŸ”₯

Creates a web API project with AOT publish enabled. For more info, see Native AOT deployment and The Web API (Native AOT) template.

  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template.
  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Defaults by SDK version:

  • SDK version 9.0 β†’ default value net9.0
  • SDK version 8.0 β†’ default value net8.0
  • --no-restore β€” doesn't run an implicit restore during project creation.
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

webapi πŸ’…

  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use. Possible values:
    • None β€” no authentication (Default).
    • IndividualB2C β€” individual authentication with Azure AD B2C.
    • SingleOrg β€” organizational authentication for a single tenant. Entra External ID tenants also use SingleOrg.
    • Windows β€” Windows authentication.
  • --aad-b2c-instance <INSTANCE> β€” the Azure Active Directory B2C instance to connect to. Use with IndividualB2C authentication. Default is https://login.microsoftonline.com/tfp/.
  • -minimal, --use-minimal-apis β€” create a project that uses the ASP.NET Core minimal API. Default is false, but this option gets overridden by -controllers. And since the default for -controllers is false, just entering dotnet new webapi without specifying either option creates a minimal API project. no cap ✨
  • -ssp, --susi-policy-id <ID> β€” the sign-in and sign-up policy ID for this project. Use with IndividualB2C authentication.
  • --aad-instance <INSTANCE> β€” the Azure Active Directory instance to connect to. Use with SingleOrg authentication. Default is https://login.microsoftonline.com/.
  • --client-id <ID> β€” the Client ID for this project. Use with IndividualB2C or SingleOrg authentication. Default is 11111111-1111-1111-11111111111111111.
  • -controllers, --use-controllers β€” whether to use controllers instead of minimal APIs. If both this option and -minimal are specified, this option overrides the value specified by -minimal. Default is false. Available since .NET 8 SDK.
  • --domain <DOMAIN> β€” the domain for the directory tenant. Use with IndividualB2C or SingleOrg authentication. Default is qualified.domain.name.
  • --tenant-id <ID> β€” the TenantId ID of the directory to connect to. Use with SingleOrg authentication. Default is 22222222-2222-2222-2222-222222222222.
  • -r, --org-read-access β€” allows this application read-access to the directory. Only applies to SingleOrg authentication.
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template.
  • --no-openapi β€” turns off OpenAPI (Swagger) support. AddOpenApi and MapOpenApi aren't called.
  • --no-https β€” turns off HTTPS. No https launch profile is created in launchSettings.json. app.UseHsts and app.UseHttpsRedirection aren't called in Program.cs/Startup.cs. This option only applies if IndividualB2C or SingleOrg aren't being used for authentication.
  • -uld, --use-local-db β€” specifies LocalDB should be used instead of SQLite. Only applies to IndividualB2C authentication.
  • -f, --framework <FRAMEWORK> β€” specifies the framework to target.

Defaults by SDK version, bestie:

  • SDK version 9.0 β†’ default value net9.0
  • SDK version 8.0 β†’ default value net8.0
  • SDK version 7.0 β†’ default value net7.0

To create a project that targets a framework earlier than the SDK you're using, see --framework for console projects earlier in this article.

  • --no-restore β€” doesn't run an implicit restore during project creation.
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

apicontroller πŸ¦‹

API Controller with or without read/write actions.

  • -p:n, --name <NAME> β€” the namespace for the generated code. Default is MyApp.Namespace.
  • -ac, --actions β€” create a controller with read/write actions. Default is false.

globaljson 🌈

  • --sdk-version <VERSION_NUMBER> β€” specifies the version of the .NET SDK to use in the global.json file.
  • --roll-forward <ROLL_FORWARD_POLICY> β€” 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 info, see global-json.
  • --test-runner <TEST_RUNNER> β€” this option was introduced in .NET 10 SDK and specifies the test runner to use, either VSTest or Microsoft.Testing.Platform. The default is VSTest.

sln πŸ’–

Creates an empty solution file containing no projects.

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.

  • --empty β€” creates an empty .editorconfig instead of the defaults for .NET.

Discontinued templates πŸ’€

The following templates have been discontinued and no longer come preinstalled with the .NET SDK. To see any template-specific options, select the short name link.

  • ASP.NET Core with Angular β€” short name angular, language [C#], tags Web/MVC/SPA, discontinued since 8.0
  • ASP.NET Core with React.js β€” short name react, language [C#], tags Web/MVC/SPA, discontinued since 8.0
  • Blazor Server App β€” short name blazorserver, language [C#], tags Web/Blazor, discontinued since 8.0
  • Blazor Server App Empty β€” short name blazorserver-empty, language [C#], tags Web/Blazor, discontinued since 8.0
  • Blazor WebAssembly App Empty β€” short name blazorwasm-empty, language [C#], tags Web/Blazor/WebAssembly, discontinued since 8.0

angular, react 😭

Discontinued since .NET 8 SDK.

  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use.

Possible values:

  • None β€” no authentication (Default).
  • Individual β€” individual authentication.
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template.
  • --no-restore β€” doesn't run an implicit restore during project creation.
  • --no-https β€” turns off HTTPS. This option only applies if authentication is None.
  • -uld, --use-local-db
  • -uld, --use-local-db β€” tells it to use LocalDB instead of SQLite πŸ’Ύ. Only applies to Individual or IndividualB2C authentication, so don't come for it otherwise.
  • -f, --framework <FRAMEWORK> β€” picks which framework you're targeting, bestie 🎯.

The default value depends on which SDK version you're running, so here's the tea:

  • 7.0 β†’ net7.0
ok so real talk: there isn't a React template for net8.0, however, if you're interested in developing React apps with ASP.NET Core, see Overview of Single Page Apps (SPAs) in ASP.NET Core. πŸ¦‹

Wanna target a framework earlier than the SDK you're using? Go see --framework for console projects earlier in this article. iykyk.

  • --kestrelHttpPort β€” port number to use for the HTTP endpoint in launchSettings.json. πŸ”Œ
  • --kestrelHttpsPort β€” port number to use for the HTTPS endpoint in launchSettings.json. This one is not applicable when the parameter no-https is used β€” but plot twist, no-https gets ignored when an individual or organizational authentication setting is chosen for --auth. πŸ’€
  • --use-program-main β€” if you specify this, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false. Old-school main character energy, honestly.

🧊 blazorserver

Discontinued since .NET 8 SDK. She's gone, bestie β€” it's giving retirement era 😭.

  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use. The possible values are:
    • None β€” no authentication (Default).
    • Individual β€” individual authentication.
    • IndividualB2C β€” individual authentication with Azure AD B2C.
    • SingleOrg β€” organizational authentication for a single tenant. Entra External ID tenants also use SingleOrg.
    • MultiOrg β€” organizational authentication for multiple tenants.
    • Windows β€” Windows authentication.
  • --aad-b2c-instance <INSTANCE> β€” the Azure Active Directory B2C instance to connect to. Use with IndividualB2C authentication. Default value is https://login.microsoftonline.com/tfp/.
  • -ssp, --susi-policy-id <ID> β€” the sign-in and sign-up policy ID for this project. Use with IndividualB2C authentication.
  • -rp, --reset-password-policy-id <ID> β€” the reset password policy ID for this project. Use with IndividualB2C authentication.
  • -ep, --edit-profile-policy-id <ID> β€” the edit profile policy ID for this project. Use with IndividualB2C authentication.
  • --aad-instance <INSTANCE> β€” the Azure Active Directory instance to connect to. Use with SingleOrg or MultiOrg authentication. Default value is https://login.microsoftonline.com/.
  • --client-id <ID> β€” the Client ID for this project. Use with IndividualB2C, SingleOrg, or MultiOrg authentication. Default value is 11111111-1111-1111-11111111111111111.
  • --domain <DOMAIN> β€” the domain for the directory tenant. Use with SingleOrg or IndividualB2C authentication. Default value is qualified.domain.name.
  • --tenant-id <ID> β€” the TenantId ID of the directory to connect to. Use with SingleOrg authentication. Default value is 22222222-2222-2222-2222-222222222222.
  • --callback-path <PATH> β€” the request path within the application's base path of the redirect URI. Use with SingleOrg or IndividualB2C authentication. Default value is /signin-oidc.
  • -r, --org-read-access β€” allows this application read-access to the directory. Only applies to SingleOrg or MultiOrg authentication.
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template. bye felicia πŸ‘‹
  • --no-https β€” turns off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't being used for --auth.
  • -uld, --use-local-db β€” specifies LocalDB should be used instead of SQLite. Only applies to Individual or IndividualB2C authentication.
  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • --kestrelHttpPort β€” port number to use for the HTTP endpoint in launchSettings.json.
  • --kestrelHttpsPort β€” port number to use for the HTTPS endpoint in launchSettings.json. Not applicable when the parameter no-https is used (but no-https is ignored when an individual or organizational authentication setting is chosen for --auth).
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

🌈 blazorwasm

  • -f, --framework <FRAMEWORK> β€” specifies the framework to target. ✨

The default values according to the SDK version number you're using:

  • 9.0 β†’ net9.0
  • 8.0 β†’ net8.0
  • 7.0 β†’ net7.0

To create a project that targets a framework earlier than the SDK that you're using, see --framework for console projects earlier in this article.

  • --no-restore β€” doesn't execute an implicit restore during project creation.
  • -ho, --hosted β€” includes an ASP.NET Core host for the Blazor WebAssembly app. hosting era 🏠
  • -au, --auth <AUTHENTICATION_TYPE> β€” the type of authentication to use. The possible values are:
    • None β€” no authentication (Default).
    • Individual β€” individual authentication.
    • IndividualB2C β€” individual authentication with Azure AD B2C.
    • SingleOrg β€” organizational authentication for a single tenant. Entra External ID tenants also use SingleOrg.
  • --authority <AUTHORITY> β€” the authority of the OIDC provider. Use with Individual authentication. Default value is https://login.microsoftonline.com/.
  • --aad-b2c-instance <INSTANCE> β€” the Azure Active Directory B2C instance to connect to. Use with IndividualB2C authentication. Default value is https://aadB2CInstance.b2clogin.com/.
  • -ssp, --susi-policy-id <ID> β€” the sign-in and sign-up policy ID for this project. Use with IndividualB2C authentication.
  • --aad-instance <INSTANCE> β€” the Azure Active Directory instance to connect to. Use with SingleOrg authentication. Default value is https://login.microsoftonline.com/.
  • --client-id <ID> β€” the Client ID for this project. Use with IndividualB2C, SingleOrg, or Individual authentication in standalone scenarios. Default value is 33333333-3333-3333-33333333333333333.
  • --domain <DOMAIN> β€” the domain for the directory tenant. Use with SingleOrg or IndividualB2C authentication. Default value is qualified.domain.name.
  • --app-id-uri <URI> β€” the App ID Uri for the server API you want to call. Use with SingleOrg or IndividualB2C authentication. Default value is api.id.uri.
  • --api-client-id <ID> β€” the Client ID for the API that the server hosts. Use with SingleOrg or IndividualB2C authentication. Default value is 11111111-1111-1111-11111111111111111.
  • -s, --default-scope <SCOPE> β€” the API scope the client needs to request to provision an access token. Use with SingleOrg or IndividualB2C authentication. Default value is user_impersonation.
  • --tenant-id <ID> β€” the TenantId ID of the directory to connect to. Use with SingleOrg authentication. Default value is 22222222-2222-2222-2222-222222222222.
  • -r, --org-read-access β€” allows this application read-access to the directory. Only applies to SingleOrg authentication.
  • --exclude-launch-settings β€” excludes launchSettings.json from the generated template.
  • -p, --pwa β€” produces a Progressive Web Application (PWA) supporting installation and offline use. lowkey iconic πŸ“±
  • --no-https β€” turns off HTTPS. This option only applies if Individual, IndividualB2C, or SingleOrg aren't being used for --auth.
  • -uld, --use-local-db β€” specifies LocalDB should be used instead of SQLite. Only applies to Individual or IndividualB2C authentication.
  • --called-api-url <URL> β€” URL of the API to call from the web app. Only applies to SingleOrg or IndividualB2C authentication without an ASP.NET Core host specified. Default value is https://graph.microsoft.com/v1.0/me.
  • --calls-graph β€” specifies if the web app calls Microsoft Graph. Only applies to SingleOrg authentication.
  • --called-api-scopes <SCOPES> β€” scopes to request to call the API from the web app. Only applies to SingleOrg or IndividualB2C authentication without an ASP.NET Core host specified. The default is user.read.
  • --kestrelHttpPort β€” port number to use for the HTTP endpoint in launchSettings.json.
  • --kestrelHttpsPort β€” port number to use for the HTTPS endpoint in launchSettings.json. Not applicable when the parameter no-https is used (but no-https is ignored when an individual or organizational authentication setting is chosen for --auth).
  • --use-program-main β€” if specified, an explicit Program class and Main method will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value: false.

πŸ‘€ SEE ALSO

  • dotnet new command
  • dotnet new list command
  • Custom templates for dotnet new
  • Create a custom template for dotnet new
  • Implicit using directives

and that's a wrap on this whole page, bestie 🫢 This one's from the dotnet-new-sdk-templates(7) source, dated 2025-10-30 β€” go forth and scaffold something gorgeous, no cap πŸ’…βœ¨

πŸ“¦ where this page comes from
  • 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms