diff --git a/docs/core/testing/unit-testing-code-coverage.md b/docs/core/testing/unit-testing-code-coverage.md index bd3aee72270b7..9b67e0b02a801 100644 --- a/docs/core/testing/unit-testing-code-coverage.md +++ b/docs/core/testing/unit-testing-code-coverage.md @@ -22,7 +22,7 @@ The "system under test" refers to the code that you're writing unit tests agains ### Create a class library -From a command prompt in a new directory named `UnitTestingCodeCoverage`, create a new .NET standard class library using the [`dotnet new classlib`](../tools/dotnet-new.md#classlib) command: +From a command prompt in a new directory named `UnitTestingCodeCoverage`, create a new .NET standard class library using the [`dotnet new classlib`](../tools/dotnet-new-sdk-templates.md#classlib) command: ```dotnetcli dotnet new classlib -n Numbers @@ -60,7 +60,7 @@ namespace System.Numbers ### Create test projects -Create two new **xUnit Test Project (.NET Core)** templates from the same command prompt using the [`dotnet new xunit`](../tools/dotnet-new.md#test) command: +Create two new **xUnit Test Project (.NET Core)** templates from the same command prompt using the [`dotnet new xunit`](../tools/dotnet-new-sdk-templates.md#test) command: ```dotnetcli dotnet new xunit -n XUnit.Coverlet.Collector diff --git a/docs/core/tools/dotnet-new-install.md b/docs/core/tools/dotnet-new-install.md new file mode 100644 index 0000000000000..1e1ad28350c9e --- /dev/null +++ b/docs/core/tools/dotnet-new-install.md @@ -0,0 +1,62 @@ +--- +title: dotnet new --install option +description: The dotnet new --install option installs a template package. +ms.date: 04/29/2021 +--- +# dotnet new --install option + +**This article applies to:** ✔️ .NET Core 2.0 SDK and later versions + +## Name + +`dotnet new --install` - installs a template package. + +## Synopsis + +```dotnetcli +dotnet new --install [--interactive] [--nuget-source ] +``` + +## Description + +The `dotnet new --install` command installs a template package from the `PATH` or `NUGET_ID` provided. If you want to install a prerelease version of a template package, specify the version in the format `::`. By default, `dotnet new` passes \* for the version, which represents the latest stable package version. For more information, see the [Examples](#examples) section. + + If a version of the template was already installed when you run this command, the template will be updated to the specified version, or to the latest stable version if no version was specified. + For information on creating custom templates, see [Custom templates for dotnet new](custom-templates.md). + +## Options + +- **`--interactive`** + + Allows the command to stop and wait for user input or action (for example to complete authentication). Available since .NET Core 5.0 SDK. + +- **`--nuget-source `** + + By default, `dotnet new --install` uses the hierarchy of NuGet configuration files from the current directory to determine the NuGet source the package can be installed from. If `--nuget-source` is specified, the source will be added to the list of sources to be checked. + To check the configured sources for the current directory use [`dotnet nuget list source`](dotnet-nuget-list-source.md). For more information, see [Common NuGet Configurations](/nuget/consume-packages/configuring-nuget-behavior) + +## Examples + +- Install the latest version of SPA templates for ASP.NET Core: + + ```dotnetcli + dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates + ``` + +- Install version 2.0 of the SPA templates for ASP.NET Core: + + ```dotnetcli + dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0 + ``` + +- Install version 2.0 of the SPA templates for ASP.NET Core from a custom NuGet source using interactive mode: + + ```dotnetcli + dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0 --nuget-source "https://api.my-custom-nuget.com/v3/index.json" --interactive + ``` + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --search option](dotnet-new-search.md) +- [Custom templates for dotnet new](custom-templates.md) diff --git a/docs/core/tools/dotnet-new-list.md b/docs/core/tools/dotnet-new-list.md new file mode 100644 index 0000000000000..9b058c122de91 --- /dev/null +++ b/docs/core/tools/dotnet-new-list.md @@ -0,0 +1,109 @@ +--- +title: dotnet new --list option +description: The dotnet new --list option lists available templates. +ms.date: 04/29/2021 +--- +# dotnet new --list option + +**This article applies to:** ✔️ .NET Core 2.0 SDK and later versions + +## Name + +`dotnet new --list` - Lists available templates to be run using `dotnet new`. + +## Synopsis + +```dotnetcli +dotnet new [] -l|--list [--author ] [-lang|--language {"C#"|"F#"|VB}] + [--tag ] [--type ] [--columns ] [--columns-all] +``` + +## Description + +The `dotnet new --list` option lists available templates to use with `dotnet new`. If the is specified, lists templates containing the specified name. This option lists only default and installed templates. To find templates in NuGet that you can install locally, use the [`--search`](dotnet-new-search.md) option. + +## Arguments + +- **`TEMPLATE_NAME`** + + If the argument is specified, only the templates containing `` in template name or short name will be shown. + +## Options + +- **`--author `** + + Filters templates based on template author. Partial match is supported. Available since .NET Core 5.0.300 SDK. + +- **`--columns `** + + Comma-separated list of columns to display in the output. The supported columns are: + - `language` - A comma-separated list of languages supported by the template. + - `tags` - The list of template tags. + - `author` - The template author. + - `type` - The template type: project or item. + + The template name and short name are always shown. The default list of columns is template name, short name, language, and tags. This list is equivalent to specifying `--columns=language,tags`. + Available since .NET Core 5.0.300 SDK. + +- **`--columns-all`** + + Displays all columns in the output. Available since .NET Core 5.0.300 SDK. + +- **`-lang|--language {C#|F#|VB}`** + + Filters templates based on language supported by the template. The language accepted varies by the template. Not valid for some templates. + + > [!NOTE] + > Some shells interpret `#` as a special character. In those cases, enclose the language parameter value in quotes. For example, `dotnet new --list --language "F#"`. + +- **`--tag `** + + Filters templates based on template tags. To be selected, a template must have at least one tag that exactly matches the criteria. Available since .NET Core 5.0.300 SDK. + +- **`--type `** + + Filters templates based on template type. Predefined values are `project` and `item`. + +## Examples + +- List all templates + + ```dotnetcli + dotnet new --list + ``` + +- List all Single Page Application (SPA) templates: + + ```dotnetcli + dotnet new spa --list + ``` + +- List all templates matching the *we* substring. + + ```dotnetcli + dotnet new we --list + ``` + +- List all templates matching the *we* substring that support the F# language. + + ```dotnetcli + dotnet new we --list --language "F#" + ``` + +- List all item templates. + + ```dotnetcli + dotnet new --list --type item + ``` + +- List all C# templates, showing the author and the type in the output. + + ```dotnetcli + dotnet new --list --language "C#" --columns "author,type" + ``` + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --search option](dotnet-new-search.md) +- [Custom templates for dotnet new](custom-templates.md) diff --git a/docs/core/tools/dotnet-new-sdk-templates.md b/docs/core/tools/dotnet-new-sdk-templates.md new file mode 100644 index 0000000000000..740365d670587 --- /dev/null +++ b/docs/core/tools/dotnet-new-sdk-templates.md @@ -0,0 +1,680 @@ +--- +title: .NET default templates for dotnet new +description: The information about dotnet new templates shipped with dotnet SDK. +no-loc: [Blazor, WebAssembly] +ms.date: 04/29/2021 +--- +# .NET 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` command with the `-l|--list` option: + +```dotnetcli +dotnet new --list +``` + + The following table shows the templates that come pre-installed with the .NET SDK. The default language for the template is shown inside the brackets. Click on the short name link to see the specific template options. + +| Templates | Short name | Language | Tags | Introduced | +|----------------------------------------------|-----------------------------------|--------------|---------------------------------------|------------| +| Console Application | [`console`](#console) | [C#], F#, VB | Common/Console | 1.0 | +| Class library | [`classlib`](#classlib) | [C#], F#, VB | Common/Library | 1.0 | +| WPF Application | [`wpf`](#wpf) | [C#], VB | Common/WPF | 3.0 (5.0 for VB)| +| WPF Class library | [`wpflib`](#wpf) | [C#], VB | Common/WPF | 3.0 (5.0 for VB)| +| WPF Custom Control Library | [`wpfcustomcontrollib`](#wpf) | [C#], VB | Common/WPF | 3.0 (5.0 for VB)| +| WPF User Control Library | [`wpfusercontrollib`](#wpf) | [C#], VB | Common/WPF | 3.0 (5.0 for VB)| +| Windows Forms (WinForms) Application | [`winforms`](#winforms) | [C#], VB | Common/WinForms | 3.0 (5.0 for VB)| +| Windows Forms (WinForms) Class library | [`winformslib`](#winforms) | [C#], VB | Common/WinForms | 3.0 (5.0 for VB)| +| Worker Service | [`worker`](#web-others) | [C#] | Common/Worker/Web | 3.0 | +| Unit Test Project | [`mstest`](#test) | [C#], F#, VB | Test/MSTest | 1.0 | +| NUnit 3 Test Project | [`nunit`](#nunit) | [C#], F#, VB | Test/NUnit | 2.1.400 | +| NUnit 3 Test Item | `nunit-test` | [C#], F#, VB | Test/NUnit | 2.2 | +| xUnit Test Project | [`xunit`](#test) | [C#], F#, VB | Test/xUnit | 1.0 | +| Razor Component | `razorcomponent` | [C#] | Web/ASP.NET | 3.0 | +| Razor Page | [`page`](#page) | [C#] | Web/ASP.NET | 2.0 | +| MVC ViewImports | [`viewimports`](#namespace) | [C#] | Web/ASP.NET | 2.0 | +| MVC ViewStart | `viewstart` | [C#] | Web/ASP.NET | 2.0 | +| Blazor Server App | [`blazorserver`](#blazorserver) | [C#] | Web/Blazor | 3.0 | +| Blazor WebAssembly App | [`blazorwasm`](#blazorwasm) | [C#] | Web/Blazor/WebAssembly | 3.1.300 | +| ASP.NET Core Empty | [`web`](#web) | [C#], F# | Web/Empty | 1.0 | +| ASP.NET Core Web App (Model-View-Controller) | [`mvc`](#web-options) | [C#], F# | Web/MVC | 1.0 | +| ASP.NET Core Web App | [`webapp, razor`](#web-options) | [C#] | Web/MVC/Razor Pages | 2.2, 2.0 | +| ASP.NET Core with Angular | [`angular`](#spa) | [C#] | Web/MVC/SPA | 2.0 | +| ASP.NET Core with React.js | [`react`](#spa) | [C#] | Web/MVC/SPA | 2.0 | +| ASP.NET Core with React.js and Redux | [`reactredux`](#reactredux) | [C#] | Web/MVC/SPA | 2.0 | +| Razor Class Library | [`razorclasslib`](#razorclasslib) | [C#] | Web/Razor/Library/Razor Class Library | 2.1 | +| ASP.NET Core Web API | [`webapi`](#webapi) | [C#], F# | Web/WebAPI | 1.0 | +| ASP.NET Core gRPC Service | [`grpc`](#web-others) | [C#] | Web/gRPC | 3.0 | +| dotnet gitignore file | `gitignore` | | Config | 3.0 | +| global.json file | [`globaljson`](#globaljson) | | Config | 2.0 | +| 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 | +| Protocol Buffer File | [`proto`](#namespace) | | Web/gRPC | 3.0 | + +## Template options + +Each template may have additional options available. The core templates have the following additional options: + +### `console` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Available since .NET Core 3.0 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + +- **`--langVersion `** + + Sets the `LangVersion` property in the created project file. For example, use `--langVersion 7.3` to use C# 7.3. Not supported for F#. Available since .NET Core 2.2 SDK. + + For a list of default C# versions, see [Defaults](../../csharp/language-reference/configure-language-version.md#defaults). + +- **`--no-restore`** + + If specified, doesn't execute an implicit restore during project creation. Available since .NET Core 2.2 SDK. + +*** + +### `classlib` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Values: `net5.0` or `netcoreapp` to create a .NET Class Library or `netstandard` to create a .NET Standard Class Library. The default value for .NET 5.0 SDK is `net5.0`. + +- **`--langVersion `** + + Sets the `LangVersion` property in the created project file. For example, use `--langVersion 7.3` to use C# 7.3. Not supported for F#. Available since .NET Core 2.2 SDK. + + For a list of default C# versions, see [Defaults](../../csharp/language-reference/configure-language-version.md#defaults). + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `wpf`, `wpflib`, `wpfcustomcontrollib`, `wpfusercontrollib` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. The default value is `net5.0`. Available since .NET Core 3.1 SDK. + +- **`--langVersion `** + + 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](../../csharp/language-reference/configure-language-version.md#defaults). + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `winforms`, `winformslib` + +- **`--langVersion `** + + 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](../../csharp/language-reference/configure-language-version.md#defaults). + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `worker`, `grpc` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. The default value is `netcoreapp3.1`. Available since .NET Core 3.1 SDK. + +- **`--exclude-launch-settings`** + + Excludes *launchSettings.json* from the generated template. + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `mstest`, `xunit` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option available since .NET Core 3.0 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + +- **`-p|--enable-pack`** + + Enables packaging for the project using [dotnet pack](dotnet-pack.md). + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `nunit` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + | 2.2 | `netcoreapp2.2` | + | 2.1 | `netcoreapp2.1` | + +- **`-p|--enable-pack`** + + Enables packaging for the project using [dotnet pack](dotnet-pack.md). + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `page` + +- **`-na|--namespace `** + + Namespace for the generated code. The default value is `MyApp.Namespace`. + +- **`-np|--no-pagemodel`** + + Creates the page without a PageModel. + +*** + +### `viewimports`, `proto` + +- **`-na|--namespace `** + + Namespace for the generated code. The default value is `MyApp.Namespace`. + +*** + +### `blazorserver` + +- **`-au|--auth `** + + 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. + - `MultiOrg` - Organizational authentication for multiple tenants. + - `Windows` - Windows authentication. + +- **`--aad-b2c-instance `** + + The Azure Active Directory B2C instance to connect to. Use with `IndividualB2C` authentication. The default value is `https://login.microsoftonline.com/tfp/`. + +- **`-ssp|--susi-policy-id `** + + The sign-in and sign-up policy ID for this project. Use with `IndividualB2C` authentication. + +- **`-rp|--reset-password-policy-id `** + + The reset password policy ID for this project. Use with `IndividualB2C` authentication. + +- **`-ep|--edit-profile-policy-id `** + + The edit profile policy ID for this project. Use with `IndividualB2C` authentication. + +- **`--aad-instance `** + + The Azure Active Directory instance to connect to. Use with `SingleOrg` or `MultiOrg` authentication. The default value is `https://login.microsoftonline.com/`. + +- **`--client-id `** + + The Client ID for this project. Use with `IndividualB2C`, `SingleOrg`, or `MultiOrg` authentication. The default value is `11111111-1111-1111-11111111111111111`. + +- **`--domain `** + + The domain for the directory tenant. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `qualified.domain.name`. + +- **`--tenant-id `** + + The TenantId ID of the directory to connect to. Use with `SingleOrg` authentication. The default value is `22222222-2222-2222-2222-222222222222`. + +- **`--callback-path `** + + The request path within the application's base path of the redirect URI. Use with `SingleOrg` or `IndividualB2C` authentication. The 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. + +- **`--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. + +*** + +### `blazorwasm` + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +- **`-ho|--hosted`** + + Includes an ASP.NET Core host for the Blazor WebAssembly app. + +- **`-au|--auth `** + + 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. + +- **`--authority `** + + The authority of the OIDC provider. Use with `Individual` authentication. The default value is `https://login.microsoftonline.com/`. + +- **`--aad-b2c-instance `** + + The Azure Active Directory B2C instance to connect to. Use with `IndividualB2C` authentication. The default value is `https://aadB2CInstance.b2clogin.com/`. + +- **`-ssp|--susi-policy-id `** + + The sign-in and sign-up policy ID for this project. Use with `IndividualB2C` authentication. + +- **`--aad-instance `** + + The Azure Active Directory instance to connect to. Use with `SingleOrg` authentication. The default value is `https://login.microsoftonline.com/`. + +- **`--client-id `** + + The Client ID for this project. Use with `IndividualB2C`, `SingleOrg`, or `Individual` authentication in standalone scenarios. The default value is `33333333-3333-3333-33333333333333333`. + +- **`--domain `** + + The domain for the directory tenant. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `qualified.domain.name`. + +- **`--app-id-uri `** + + The App ID Uri for the server API you want to call. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `api.id.uri`. + +- **`--api-client-id `** + + The Client ID for the API that the server hosts. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `11111111-1111-1111-11111111111111111`. + +- **`-s|--default-scope `** + + The API scope the client needs to request to provision an access token. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `user_impersonation`. + +- **`--tenant-id `** + + The TenantId ID of the directory to connect to. Use with `SingleOrg` authentication. The 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. + +- **`--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 of the API to call from the web app. Only applies to `SingleOrg` or `IndividualB2C` authentication without an ASP.NET Core host specified. The 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 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`. + +*** + +### `web` + +- **`--exclude-launch-settings`** + + Excludes *launchSettings.json* from the generated template. + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option not available in .NET Core 2.2 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + | 2.1 | `netcoreapp2.1` | + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +- **`--no-https`** + + Turns off HTTPS. + +*** + +### `mvc`, `webapp` + +- **`-au|--auth `** + + 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. + - `MultiOrg` - Organizational authentication for multiple tenants. + - `Windows` - Windows authentication. + +- **`--aad-b2c-instance `** + + The Azure Active Directory B2C instance to connect to. Use with `IndividualB2C` authentication. The default value is `https://login.microsoftonline.com/tfp/`. + +- **`-ssp|--susi-policy-id `** + + The sign-in and sign-up policy ID for this project. Use with `IndividualB2C` authentication. + +- **`-rp|--reset-password-policy-id `** + + The reset password policy ID for this project. Use with `IndividualB2C` authentication. + +- **`-ep|--edit-profile-policy-id `** + + The edit profile policy ID for this project. Use with `IndividualB2C` authentication. + +- **`--aad-instance `** + + The Azure Active Directory instance to connect to. Use with `SingleOrg` or `MultiOrg` authentication. The default value is `https://login.microsoftonline.com/`. + +- **`--client-id `** + + The Client ID for this project. Use with `IndividualB2C`, `SingleOrg`, or `MultiOrg` authentication. The default value is `11111111-1111-1111-11111111111111111`. + +- **`--domain `** + + The domain for the directory tenant. Use with `SingleOrg` or `IndividualB2C` authentication. The default value is `qualified.domain.name`. + +- **`--tenant-id `** + + The TenantId ID of the directory to connect to. Use with `SingleOrg` authentication. The default value is `22222222-2222-2222-2222-222222222222`. + +- **`--callback-path `** + + The request path within the application's base path of the redirect URI. Use with `SingleOrg` or `IndividualB2C` authentication. The 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. + +- **`--no-https`** + + Turns off HTTPS. This option only applies if `Individual`, `IndividualB2C`, `SingleOrg`, or `MultiOrg` aren't being used. + +- **`-uld|--use-local-db`** + + Specifies LocalDB should be used instead of SQLite. Only applies to `Individual` or `IndividualB2C` authentication. + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option available since .NET Core 3.0 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +- **`--use-browserlink`** + + Includes BrowserLink in the project. Option not available in .NET Core 2.2 and 3.1 SDK. + +- **`-rrc|--razor-runtime-compilation`** + + Determines if the project is configured to use [Razor runtime compilation](/aspnet/core/mvc/views/view-compilation#runtime-compilation) in Debug builds. Option available since .NET Core 3.1.201 SDK. + +*** + +### `angular`, `react` + +- **`-au|--auth `** + + The type of authentication to use. Available since .NET Core 3.0 SDK. + + The possible values are: + + - `None` - No authentication (Default). + - `Individual` - Individual authentication. + +- **`--exclude-launch-settings`** + + Excludes *launchSettings.json* from the generated template. + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +- **`--no-https`** + + Turns off HTTPS. This option only applies if authentication is `None`. + +- **`-uld|--use-local-db`** + + Specifies LocalDB should be used instead of SQLite. Only applies to `Individual` or `IndividualB2C` authentication. Available since .NET Core 3.0 SDK. + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option not available in .NET Core 2.2 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + | 2.1 | `netcoreapp2.0` | + +*** + +### `reactredux` + +- **`--exclude-launch-settings`** + + Excludes *launchSettings.json* from the generated template. + +- **`-f|--framework `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option not available in .NET Core 2.2 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + | 2.1 | `netcoreapp2.0` | + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +- **`--no-https`** + + Turns off HTTPS. + +*** + +### `razorclasslib` + +- **`--no-restore`** + + Doesn't execute 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. Available since .NET Core 3.0 SDK. + +*** + +### `webapi` + +- **`-au|--auth `** + + The type of authentication to use. The possible values are: + + - `None` - No authentication (Default). + - `IndividualB2C` - Individual authentication with Azure AD B2C. + - `SingleOrg` - Organizational authentication for a single tenant. + - `Windows` - Windows authentication. + +- **`--aad-b2c-instance `** + + The Azure Active Directory B2C instance to connect to. Use with `IndividualB2C` authentication. The default value is `https://login.microsoftonline.com/tfp/`. + +- **`-ssp|--susi-policy-id `** + + The sign-in and sign-up policy ID for this project. Use with `IndividualB2C` authentication. + +- **`--aad-instance `** + + The Azure Active Directory instance to connect to. Use with `SingleOrg` authentication. The default value is `https://login.microsoftonline.com/`. + +- **`--client-id `** + + The Client ID for this project. Use with `IndividualB2C` or `SingleOrg` authentication. The default value is `11111111-1111-1111-11111111111111111`. + +- **`--domain `** + + The domain for the directory tenant. Use with `IndividualB2C` or `SingleOrg` authentication. The default value is `qualified.domain.name`. + +- **`--tenant-id `** + + The TenantId ID of the directory to connect to. Use with `SingleOrg` authentication. The 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. + +- **`--no-https`** + + Turns off HTTPS. `app.UseHsts` and `app.UseHttpsRedirection` aren't added to `Startup.Configure`. 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 `** + + Specifies the [framework](../../standard/frameworks.md) to target. Option not available in .NET Core 2.2 SDK. + + The following table lists the default values according to the SDK version number you're using: + + | SDK version | Default value | + |-------------|-----------------| + | 5.0 | `net5.0` | + | 3.1 | `netcoreapp3.1` | + | 3.0 | `netcoreapp3.0` | + | 2.1 | `netcoreapp2.1` | + +- **`--no-restore`** + + Doesn't execute an implicit restore during project creation. + +*** + +### `globaljson` + +- **`--sdk-version `** + + Specifies the version of the .NET SDK to use in the *global.json* file. + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --list option](dotnet-new-list.md) +- [Custom templates for dotnet new](custom-templates.md) +- [Create a custom template for dotnet new](../tutorials/cli-templates-create-item-template.md) diff --git a/docs/core/tools/dotnet-new-search.md b/docs/core/tools/dotnet-new-search.md new file mode 100644 index 0000000000000..50c9c9655eaf0 --- /dev/null +++ b/docs/core/tools/dotnet-new-search.md @@ -0,0 +1,104 @@ +--- +title: dotnet new --search option +description: The dotnet new --search option searches for templates on NuGet.org. +ms.date: 04/29/2021 +--- +# dotnet new --search option + +**This article applies to:** ✔️ .NET Core 5.0.300 SDK and later versions + +## Name + +`dotnet new --search` - searches for the templates supported by `dotnet new` on NuGet.org. + +## Synopsis + +```dotnetcli +dotnet new --search + +dotnet new [] --search [--author ] [-lang|--language {"C#"|"F#"|VB}] + [--package ] [--tag ] [--type ] + [--columns ] [--columns-all] +``` + +## Description + +The `dotnet new --search` option searches for templates supported by `dotnet new` on NuGet.org. When the is specified, searches for templates containing the specified name. + +## Arguments + +- **`TEMPLATE_NAME`** + + If the argument is specified, only templates containing `` in the template name or short name will be shown. + The argument is mandatory when `--author`, `--language`, `--package`, `--tag` or `--type` options are not specified. + +## Options + +- **`--author `** + + Filters templates based on template author. Partial match is supported. + +- **`--columns `** + + Comma-separated list of columns to display in the output. The supported columns are: + - `language` - A comma-separated list of languages supported by the template. + - `tags` - The list of template tags. + - `author` - The template author. + - `type` - The template type: project or item. + + The template name, short name, package name and total downloads count are always shown. The default list of columns is template name, short name, author, language, package, and total downloads. This list is equivalent to specifying `--columns=author,language`. + +- **`--columns-all`** + + Displays all columns in the output. + +- **`-lang|--language {C#|F#|VB}`** + + Filters templates based on language supported by the template. The language accepted varies by the template. Not valid for some templates. + + > [!NOTE] + > Some shells interpret `#` as a special character. In those cases, enclose the language parameter value in quotes. For example, `dotnet new --search --language "F#"`. + +- **`--package `** + + Filters templates based on NuGet package ID. Partial match is supported. + +- **`--tag `** + + Filters templates based on template tags. To be selected, a template must have at least one tag that exactly matches the criteria. + +- **`--type `** + + Filters templates based on template type. Predefined values are `project` and `item`. + +## Examples + +- Search for all templates available on NuGet.org matching the *spa* substring. + + ```dotnetcli + dotnet new spa --search + ``` + +- Search for all templates available on NuGet.org matching the *we* substring and supporting the F# language. + + ```dotnetcli + dotnet new we --search --language "F#" + ``` + +- Search for item templates. + + ```dotnetcli + dotnet new --search --type item + ``` + +- Search for all C# templates, showing the type and tags in the output. + + ```dotnetcli + dotnet new --search --language "C#" --columns "type,tags" + ``` + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --list option](dotnet-new-list.md) +- [Custom templates for dotnet new](custom-templates.md) diff --git a/docs/core/tools/dotnet-new-uninstall.md b/docs/core/tools/dotnet-new-uninstall.md new file mode 100644 index 0000000000000..f6e8867854a55 --- /dev/null +++ b/docs/core/tools/dotnet-new-uninstall.md @@ -0,0 +1,49 @@ +--- +title: dotnet new --uninstall option +description: The dotnet new --uninstall option uninstalls a template package. +ms.date: 04/29/2021 +--- +# dotnet new --uninstall option + +**This article applies to:** ✔️ .NET Core 2.0 SDK and later versions + +## Name + +`dotnet new --uninstall` - uninstalls a template package. + +## Synopsis + +```dotnetcli + +dotnet new --uninstall + +``` + +## Description + +The `dotnet new --install` uninstalls a template package at the `PATH` or `NUGET_ID` provided. When the `` value isn't specified, all currently installed template packages and their associated templates are displayed. When specifying `NUGET_ID`, don't include the version number. + If you don't specify a parameter to this option, the command lists the installed templates and details about them. + > [!NOTE] + > To uninstall a template using a `PATH`, you need to fully qualify the path. For example, *C:/Users/\/Documents/Templates/GarciaSoftware.ConsoleTemplate.CSharp* will work, but *./GarciaSoftware.ConsoleTemplate.CSharp* from the containing folder will not. + > Don't include a final terminating directory slash on your template path. + +## Examples + +- List the installed templates and details about them, including how to uninstall them: + + ```dotnetcli + dotnet new -u + ``` + +- Uninstall the SPA templates for ASP.NET Core: + + ```dotnetcli + dotnet new -u Microsoft.DotNet.Web.Spa.ProjectTemplates + ``` + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --list option](dotnet-new-list.md) +- [dotnet new --search option](dotnet-new-search.md) +- [Custom templates for dotnet new](custom-templates.md) diff --git a/docs/core/tools/dotnet-new-update.md b/docs/core/tools/dotnet-new-update.md new file mode 100644 index 0000000000000..1438efc179608 --- /dev/null +++ b/docs/core/tools/dotnet-new-update.md @@ -0,0 +1,34 @@ +--- +title: dotnet new --update-* options +description: The dotnet new --update-* options check for and apply updates to installed template packages. +ms.date: 04/29/2021 +--- +# dotnet new --update-check and --update-apply options + +**This article applies to:** ✔️ .NET Core 3.0 SDK and later versions + +## Name + +`dotnet new --update-check` checks for available updates for installed template packages. + +`dotnet new --update-apply` applies updates to installed template packages. + +## Synopsis + +```dotnetcli +dotnet new --update-check + +dotnet new --update-apply +``` + +## Description + +The `dotnet new --update-check` option checks if there are updates available for the template packs that are currently installed. +The `dotnet new --update-apply` option checks if there are updates available for the template packages that are currently installed and installs them. + +## See also + +- [dotnet new command](dotnet-new.md) +- [dotnet new --search option](dotnet-new-search.md) +- [dotnet new --install option](dotnet-new-install.md) +- [Custom templates for dotnet new](custom-templates.md) diff --git a/docs/core/tools/dotnet-new.md b/docs/core/tools/dotnet-new.md index 054700b6cd845..20b41f1c4bd66 100644 --- a/docs/core/tools/dotnet-new.md +++ b/docs/core/tools/dotnet-new.md @@ -15,12 +15,8 @@ ms.date: 09/04/2020 ## Synopsis ```dotnetcli -dotnet new