dotnet-new-sdk-templates(7)
π 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#]β tagsWeb/Web API/API/Serviceβ introduced8.0 - ASP.NET Core API controller β short name
apicontrollerβ language[C#]β tagsWeb/ASP.NETβ introduced8.0 - ASP.NET Core Empty β short name
webβ language[C#], F#β tagsWeb/Emptyβ introduced1.0 - ASP.NET Core Web API β short name
webapiβ language[C#], F#β tagsWeb/Web API/API/Service/WebAPIβ introduced1.0 - ASP.NET Core Web App (Model-View-Controller) β short name
mvcβ language[C#], F#β tagsWeb/MVCβ introduced1.0 - ASP.NET Core Web App β short name
webapp,razorβ language[C#]β tagsWeb/MVC/Razor Pagesβ introduced2.2, 2.0 - ASP.NET Core gRPC Service β short name
grpcβ language[C#]β tagsWeb/gRPCβ introduced3.0 - Blazor Web App β short name
blazorβ language[C#]β tagsWeb/Blazorβ introduced8.0.100 - Blazor WebAssembly Standalone App β short name
blazorwasmβ language[C#]β tagsWeb/Blazor/WebAssembly/PWAβ introduced3.1.300 - Class library β short name
classlibβ language[C#], F#, VBβ tagsCommon/Libraryβ introduced1.0 - Console Application β short name
consoleβ language[C#], F#, VBβ tagsCommon/Consoleβ introduced1.0 - Directory.Build.props file β short name
buildpropsβ tagsConfigβ introduced8.0.100 - Directory.Build.targets file β short name
buildtargetsβ tagsConfigβ introduced8.0.100 - Dotnet local tool manifest file β short name
tool-manifestβ tagsConfigβ introduced3.0 - EditorConfig file β short name
editorconfigβ tagsConfigβ introduced6.0 - global.json file β short name
globaljsonβ tagsConfigβ introduced2.0 - MSTest Test Class β short name
mstest-classβ language[C#], F#, VBβ tagsTest/MSTestβ introduced1.0 - MSTest Test Project β short name
mstestβ language[C#], F#, VBβ tagsTest/MSTestβ introduced1.0 - NUnit 3 Test Item β short name
nunit-testβ language[C#], F#, VBβ tagsTest/NUnitβ introduced2.2 - NUnit 3 Test Project β short name
nunitβ language[C#], F#, VBβ tagsTest/NUnitβ introduced2.1.400 - NuGet Config β short name
nugetconfigβ tagsConfigβ introduced1.0 - Protocol Buffer File β short name
protoβ tagsWeb/gRPCβ introduced3.0 - Razor Class Library β short name
razorclasslibβ language[C#]β tagsWeb/Razor/Library/Razor Class Libraryβ introduced2.1 - Razor Component β short name
razorcomponentβ language[C#]β tagsWeb/ASP.NETβ introduced3.0 - Razor Page β short name
pageβ language[C#]β tagsWeb/ASP.NETβ introduced2.0 - Solution File β short name
slnβ tagsSolutionβ introduced1.0 - Web Config β short name
webconfigβ tagsConfigβ introduced1.0 - Windows Forms (WinForms) Application β short name
winformsβ language[C#], VBβ tagsCommon/WinFormsβ introduced3.0 (5.0 for VB) - Windows Forms (WinForms) Class library β short name
winformslibβ language[C#], VBβ tagsCommon/WinFormsβ introduced3.0 (5.0 for VB) - Worker Service β short name
workerβ language[C#]β tagsCommon/Worker/Webβ introduced3.0 - WPF Application β short name
wpfβ language[C#], VBβ tagsCommon/WPFβ introduced3.0 (5.0 for VB) - WPF Class library β short name
wpflibβ language[C#], VBβ tagsCommon/WPFβ introduced3.0 (5.0 for VB) - WPF Custom Control Library β short name
wpfcustomcontrollibβ language[C#], VBβ tagsCommon/WPFβ introduced3.0 (5.0 for VB) - WPF User Control Library β short name
wpfusercontrollibβ language[C#], VBβ tagsCommon/WPFβ introduced3.0 (5.0 for VB) - xUnit Test Project β short name
xunitβ language[C#], F#, VBβ tagsTest/xUnitβ introduced1.0 - MVC ViewImports β short name
viewimportsβ language[C#]β tagsWeb/ASP.NETβ introduced2.0 - MVC ViewStart β short name
viewstartβ language[C#]β tagsWeb/ASP.NETβ introduced2.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 anImportelement for the closestDirectory.Build.propsfile in the parent directory hierarchy. by default,Directory.Build.propsfiles 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 anImportelement for the closestDirectory.Build.targetsfile in the parent directory hierarchy. by default,Directory.Build.targetsfiles 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 valuenet9.0 - SDK version
8.0β default valuenet8.0 - SDK version
7.0β default valuenet7.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 theLangVersionproperty in the created project file. for example, use--langVersion 7.3to 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 explicitProgramclass andMainmethod 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, ornet7.0to create a .NET Class Library, ornetstandard2.1ornetstandard2.0to create a .NET Standard Class Library. the default value for .NET SDK 9.0.x isnet9.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 theLangVersionproperty in the created project file. for example, use--langVersion 7.3to 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 isnet9.0.--langVersion <VERSION_NUMBER>β sets theLangVersionproperty in the created project file. for example, use--langVersion 7.3to 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 theLangVersionproperty in the created project file. for example, use--langVersion 7.3to 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 isnet9.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β yeetslaunchSettings.jsonout 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 explicitProgramclass andMainmethod 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 theMSTest.Sdkproject 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 usingMicrosoft.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βAssemblyInitializefixture method.AssemblyCleanupβAssemblyCleanupfixture method.ClassInitializeβClassInitializefixture method.ClassCleanupβClassCleanupfixture method.TestInitializeβTestInitializefixture method.TestCleanupβTestCleanupfixture method.
Where multiple values are allowed. Stack 'em, bestie. π
-p,--enable-packβ enables packaging for the project usingdotnet pack. π¦
π mstest-class π
--fixture<FIXTURE>β the fixture kinds to include in the test project. Possible values:Noneβ no fixture methods.AssemblyInitializeβAssemblyInitializefixture method.AssemblyCleanupβAssemblyCleanupfixture method.ClassInitializeβClassInitializefixture method.ClassCleanupβClassCleanupfixture method.TestInitializeβTestInitializefixture method.TestCleanupβTestCleanupfixture 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 usingdotnet 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 usingdotnet 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 isMyApp.Namespace. π-np,--no-pagemodelβ creates the page without aPageModel. No model, just vibes. π
π§ viewimports, proto π§
-na,--namespace<NAMESPACE_NAME>β the namespace for the generated code. Default value isMyApp.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β excludeslaunchSettings.jsonfrom 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 toIndividualauthentication. π₯-ai,--all-interactiveβ makes every page interactive by applying an interactive render mode at the top level. Iffalse, 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|--interactivityoption isn't set toNone. Main character energy for every single page, honestly. π--no-httpsβ turns off HTTPS. This option only applies ifIndividualisn't chosen for the-au|--authoption.--use-program-mainβ if specified, an explicitProgramclass andMainmethod is generated instead of top-level statements.
π web π
--exclude-launch-settingsβ excludeslaunchSettings.jsonfrom 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 inlaunchSettings.json.--kestrelHttpsPortβ port number to use for the HTTPS endpoint inlaunchSettings.json. This option is not applicable when the parameterno-httpsis used (butno-httpsis 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 explicitProgramclass andMainmethod 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 useSingleOrg.MultiOrgβ organizational authentication for multiple tenants.Windowsβ Windows authentication.
--aad-b2c-instance<INSTANCE>β the Azure Active Directory B2C instance to connect to. Use withIndividualB2Cauthentication. Default value ishttps://login.microsoftonline.com/tfp/. π¦-ssp,--susi-policy-id<ID>β the sign-in and sign-up policy ID for this project. Use withIndividualB2Cauthentication.-rp,--reset-password-policy-id<ID>β the reset password policy ID for this project. Use withIndividualB2Cauthentication.-ep,--edit-profile-policy-id<ID>β the edit profile policy ID for this project. Use withIndividualB2Cauthentication. β¨--aad-instance <INSTANCE>β the Azure Active Directory instance you're connecting to. Use it withSingleOrgorMultiOrgauthentication. Default ishttps://login.microsoftonline.com/. π«--client-id <ID>β the Client ID for this project. Use it withIndividualB2C,SingleOrg, orMultiOrgauthentication. Default is11111111-1111-1111-11111111111111111.--domain <DOMAIN>β the domain for the directory tenant. Use it withSingleOrgorIndividualB2Cauthentication. Default isqualified.domain.name.--tenant-id <ID>β the TenantId ID of the directory to connect to. Use it withSingleOrgauthentication. Default is22222222-2222-2222-2222-222222222222.--callback-path <PATH>β the request path within the application's base path of the redirect URI. Use it withSingleOrgorIndividualB2Cauthentication. Default is/signin-oidc.-r,--org-read-accessβ lets this app have read-access to the directory. Only applies toSingleOrgorMultiOrgauthentication. π--exclude-launch-settingsβ excludeslaunchSettings.jsonfrom the generated template. bye bestie π«Ά--no-httpsβ turns off HTTPS. This one only applies ifIndividual,IndividualB2C,SingleOrg, orMultiOrgaren't being used.-uld,--use-local-dbβ says LocalDB should be used instead of SQLite. Only applies toIndividualorIndividualB2Cauthentication.-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 valuenet9.0 - SDK version
8.0β default valuenet8.0 - SDK version
7.0β default valuenet7.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 inlaunchSettings.json.--kestrelHttpsPortβ port number to use for the HTTPS endpoint inlaunchSettings.json. This one is not applicable when the parameterno-httpsis used (but heads up:no-httpsgets ignored when an individual or organizational authentication setting is chosen for--auth).--use-program-mainβ if you specify this, an explicitProgramclass andMainmethod get used instead of top-level statements. Available since .NET SDK6.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β excludeslaunchSettings.jsonfrom the generated template.-f,--framework <FRAMEWORK>β specifies the framework to target.
Defaults by SDK version:
- SDK version
9.0β default valuenet9.0 - SDK version
8.0β default valuenet8.0
--no-restoreβ doesn't run an implicit restore during project creation.--use-program-mainβ if specified, an explicitProgramclass andMainmethod will be used instead of top-level statements. Available since .NET SDK6.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 useSingleOrg.Windowsβ Windows authentication.
--aad-b2c-instance <INSTANCE>β the Azure Active Directory B2C instance to connect to. Use withIndividualB2Cauthentication. Default ishttps://login.microsoftonline.com/tfp/.-minimal,--use-minimal-apisβ create a project that uses the ASP.NET Core minimal API. Default isfalse, but this option gets overridden by-controllers. And since the default for-controllersisfalse, just enteringdotnet new webapiwithout 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 withIndividualB2Cauthentication.--aad-instance <INSTANCE>β the Azure Active Directory instance to connect to. Use withSingleOrgauthentication. Default ishttps://login.microsoftonline.com/.--client-id <ID>β the Client ID for this project. Use withIndividualB2CorSingleOrgauthentication. Default is11111111-1111-1111-11111111111111111.-controllers,--use-controllersβ whether to use controllers instead of minimal APIs. If both this option and-minimalare specified, this option overrides the value specified by-minimal. Default isfalse. Available since .NET 8 SDK.--domain <DOMAIN>β the domain for the directory tenant. Use withIndividualB2CorSingleOrgauthentication. Default isqualified.domain.name.--tenant-id <ID>β the TenantId ID of the directory to connect to. Use withSingleOrgauthentication. Default is22222222-2222-2222-2222-222222222222.-r,--org-read-accessβ allows this application read-access to the directory. Only applies toSingleOrgauthentication.--exclude-launch-settingsβ excludeslaunchSettings.jsonfrom the generated template.--no-openapiβ turns off OpenAPI (Swagger) support.AddOpenApiandMapOpenApiaren't called.--no-httpsβ turns off HTTPS. No https launch profile is created inlaunchSettings.json.app.UseHstsandapp.UseHttpsRedirectionaren't called inProgram.cs/Startup.cs. This option only applies ifIndividualB2CorSingleOrgaren't being used for authentication.-uld,--use-local-dbβ specifies LocalDB should be used instead of SQLite. Only applies toIndividualB2Cauthentication.-f,--framework <FRAMEWORK>β specifies the framework to target.
Defaults by SDK version, bestie:
- SDK version
9.0β default valuenet9.0 - SDK version
8.0β default valuenet8.0 - SDK version
7.0β default valuenet7.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 explicitProgramclass andMainmethod will be used instead of top-level statements. Available since .NET SDK6.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 isMyApp.Namespace.-ac,--actionsβ create a controller with read/write actions. Default isfalse.
globaljson π
--sdk-version <VERSION_NUMBER>β specifies the version of the .NET SDK to use in theglobal.jsonfile.--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, eitherVSTestorMicrosoft.Testing.Platform. The default isVSTest.
sln π
Creates an empty solution file containing no projects.
In .NET SDK9.0.200and later, this template supports a--formatoption to choose betweenslnandslnxformats. Starting with .NET 10, the default format isslnx.
editorconfig π
Creates an .editorconfig file for configuring code style preferences.
--emptyβ creates an empty.editorconfiginstead 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#], tagsWeb/MVC/SPA, discontinued since8.0 - ASP.NET Core with React.js β short name
react, language[C#], tagsWeb/MVC/SPA, discontinued since8.0 - Blazor Server App β short name
blazorserver, language[C#], tagsWeb/Blazor, discontinued since8.0 - Blazor Server App Empty β short name
blazorserver-empty, language[C#], tagsWeb/Blazor, discontinued since8.0 - Blazor WebAssembly App Empty β short name
blazorwasm-empty, language[C#], tagsWeb/Blazor/WebAssembly, discontinued since8.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β excludeslaunchSettings.jsonfrom 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 isNone.-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 inlaunchSettings.json. π--kestrelHttpsPortβ port number to use for the HTTPS endpoint inlaunchSettings.json. This one is not applicable when the parameterno-httpsis used β but plot twist,no-httpsgets ignored when an individual or organizational authentication setting is chosen for--auth. π--use-program-mainβ if you specify this, an explicitProgramclass andMainmethod 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 useSingleOrg.MultiOrgβ organizational authentication for multiple tenants.Windowsβ Windows authentication.
--aad-b2c-instance <INSTANCE>β the Azure Active Directory B2C instance to connect to. Use withIndividualB2Cauthentication. Default value ishttps://login.microsoftonline.com/tfp/.-ssp,--susi-policy-id <ID>β the sign-in and sign-up policy ID for this project. Use withIndividualB2Cauthentication.-rp,--reset-password-policy-id <ID>β the reset password policy ID for this project. Use withIndividualB2Cauthentication.-ep,--edit-profile-policy-id <ID>β the edit profile policy ID for this project. Use withIndividualB2Cauthentication.--aad-instance <INSTANCE>β the Azure Active Directory instance to connect to. Use withSingleOrgorMultiOrgauthentication. Default value ishttps://login.microsoftonline.com/.--client-id <ID>β the Client ID for this project. Use withIndividualB2C,SingleOrg, orMultiOrgauthentication. Default value is11111111-1111-1111-11111111111111111.--domain <DOMAIN>β the domain for the directory tenant. Use withSingleOrgorIndividualB2Cauthentication. Default value isqualified.domain.name.--tenant-id <ID>β the TenantId ID of the directory to connect to. Use withSingleOrgauthentication. Default value is22222222-2222-2222-2222-222222222222.--callback-path <PATH>β the request path within the application's base path of the redirect URI. Use withSingleOrgorIndividualB2Cauthentication. Default value is/signin-oidc.-r,--org-read-accessβ allows this application read-access to the directory. Only applies toSingleOrgorMultiOrgauthentication.--exclude-launch-settingsβ excludeslaunchSettings.jsonfrom the generated template. bye felicia π--no-httpsβ turns off HTTPS. This option only applies ifIndividual,IndividualB2C,SingleOrg, orMultiOrgaren't being used for--auth.-uld,--use-local-dbβ specifies LocalDB should be used instead of SQLite. Only applies toIndividualorIndividualB2Cauthentication.--no-restoreβ doesn't execute an implicit restore during project creation.--kestrelHttpPortβ port number to use for the HTTP endpoint inlaunchSettings.json.--kestrelHttpsPortβ port number to use for the HTTPS endpoint inlaunchSettings.json. Not applicable when the parameterno-httpsis used (butno-httpsis ignored when an individual or organizational authentication setting is chosen for--auth).--use-program-mainβ if specified, an explicitProgramclass andMainmethod 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.08.0βnet8.07.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 useSingleOrg.
--authority <AUTHORITY>β the authority of the OIDC provider. Use withIndividualauthentication. Default value ishttps://login.microsoftonline.com/.--aad-b2c-instance <INSTANCE>β the Azure Active Directory B2C instance to connect to. Use withIndividualB2Cauthentication. Default value ishttps://aadB2CInstance.b2clogin.com/.-ssp,--susi-policy-id <ID>β the sign-in and sign-up policy ID for this project. Use withIndividualB2Cauthentication.--aad-instance <INSTANCE>β the Azure Active Directory instance to connect to. Use withSingleOrgauthentication. Default value ishttps://login.microsoftonline.com/.--client-id <ID>β the Client ID for this project. Use withIndividualB2C,SingleOrg, orIndividualauthentication in standalone scenarios. Default value is33333333-3333-3333-33333333333333333.--domain <DOMAIN>β the domain for the directory tenant. Use withSingleOrgorIndividualB2Cauthentication. Default value isqualified.domain.name.--app-id-uri <URI>β the App ID Uri for the server API you want to call. Use withSingleOrgorIndividualB2Cauthentication. Default value isapi.id.uri.--api-client-id <ID>β the Client ID for the API that the server hosts. Use withSingleOrgorIndividualB2Cauthentication. Default value is11111111-1111-1111-11111111111111111.-s,--default-scope <SCOPE>β the API scope the client needs to request to provision an access token. Use withSingleOrgorIndividualB2Cauthentication. Default value isuser_impersonation.--tenant-id <ID>β the TenantId ID of the directory to connect to. Use withSingleOrgauthentication. Default value is22222222-2222-2222-2222-222222222222.-r,--org-read-accessβ allows this application read-access to the directory. Only applies toSingleOrgauthentication.--exclude-launch-settingsβ excludeslaunchSettings.jsonfrom 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 ifIndividual,IndividualB2C, orSingleOrgaren't being used for--auth.-uld,--use-local-dbβ specifies LocalDB should be used instead of SQLite. Only applies toIndividualorIndividualB2Cauthentication.--called-api-url <URL>β URL of the API to call from the web app. Only applies toSingleOrgorIndividualB2Cauthentication without an ASP.NET Core host specified. Default value ishttps://graph.microsoft.com/v1.0/me.--calls-graphβ specifies if the web app calls Microsoft Graph. Only applies toSingleOrgauthentication.--called-api-scopes <SCOPES>β scopes to request to call the API from the web app. Only applies toSingleOrgorIndividualB2Cauthentication without an ASP.NET Core host specified. The default isuser.read.--kestrelHttpPortβ port number to use for the HTTP endpoint inlaunchSettings.json.--kestrelHttpsPortβ port number to use for the HTTPS endpoint inlaunchSettings.json. Not applicable when the parameterno-httpsis used (butno-httpsis ignored when an individual or organizational authentication setting is chosen for--auth).--use-program-mainβ if specified, an explicitProgramclass andMainmethod will be used instead of top-level statements. Available since .NET SDK 6.0.300. Default value:false.
π SEE ALSO
dotnet newcommanddotnet new listcommand- 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