diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index 2d504ebb8bbf6..18807060783c0 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -1,7 +1,8 @@ --- title: dotnet format command description: The dotnet format command formats code to match EditorConfig settings for the current directory. -ms.date: 09/29/2025 +ms.date: 09/15/2026 +ai-usage: ai-assisted --- # dotnet format @@ -17,7 +18,7 @@ ms.date: 09/29/2025 dotnet format [] [--binarylog ] [--diagnostics ] [--exclude ] [--exclude-diagnostics ] - [--include ] [--include-generated] + [--framework ] [--include ] [--include-generated] [--no-restore] [--report ] [--severity ] [-v|--verbosity ] [--verify-no-changes] [--version] @@ -57,6 +58,10 @@ None of the options below are required for the `dotnet format` command to succee A space-separated list of diagnostic IDs to exclude when fixing code style or third-party issues. Default value is none. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). +- **`--framework `** + + Specifies the target framework moniker (TFM), such as `net11.0`, to format in a multi-targeted project. If you don't specify this option, `dotnet format` formats all target frameworks. Available starting with .NET 11. + - **`--include `** A space-separated list of relative file or folder paths to include in formatting. The default is all files in the solution or project. diff --git a/docs/core/tools/dotnet-new-install.md b/docs/core/tools/dotnet-new-install.md index ff11d744c9f02..43100f0e02071 100644 --- a/docs/core/tools/dotnet-new-install.md +++ b/docs/core/tools/dotnet-new-install.md @@ -2,7 +2,7 @@ title: dotnet new install ai-usage: ai-assisted description: The dotnet new install command installs a template package. -ms.date: 11/12/2025 +ms.date: 09/15/2026 --- # dotnet new install @@ -15,7 +15,7 @@ ms.date: 11/12/2025 ## Synopsis ```dotnetcli -dotnet new install [--interactive] [--add-source|--nuget-source ] [--force] +dotnet new install [--interactive] [--add-source|--nuget-source ] [--force] [--prerelease] [-d|--diagnostics] [--verbosity ] [-h|--help] ``` @@ -23,7 +23,7 @@ dotnet new install [--interactive] [--add-source|--nuget-source The `dotnet new install` command installs a template package from the `PATH` or `NUGET_ID` provided. If you want to install a specific version or prerelease version of a template package, specify the version in the format `@`. (The colon separator `::` was deprecated in favor of the `@` character in .NET 9.0.200 SDK.) 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 package was already installed when you run this command, the template package will be updated to the specified version. If no version is specified, the package is updated to the latest stable version. +If a version of the template package was already installed when you run this command, the template package will be updated to the specified version. If no version is specified, the package is updated to the latest stable version unless you specify the `--prerelease` option. Starting with .NET SDK 6.0.100, if the argument specifies the version, and that version of the NuGet package is already installed, it won't be reinstalled. If the argument is a `PATH` and it's already installed, it won't be reinstalled. @@ -75,6 +75,10 @@ Starting with .NET SDK 6.0.100, installed template packages are available in lat - [!INCLUDE [interactive](includes/cli-interactive.md)] +- **`--prerelease`** + + Selects the latest available version, including prerelease versions, when you don't specify a template package version. If you specify a package version, such as `Contoso.Templates@2.0.0-preview.3`, the command selects that exact version. Available since .NET SDK 11. + - [!INCLUDE [verbosity](includes/cli-verbosity.md)] ## Examples diff --git a/docs/core/tools/dotnet-reference-add.md b/docs/core/tools/dotnet-reference-add.md index 298b7c49a9d0f..e3af7cb797a69 100644 --- a/docs/core/tools/dotnet-reference-add.md +++ b/docs/core/tools/dotnet-reference-add.md @@ -1,7 +1,8 @@ --- title: dotnet reference add command description: The dotnet reference add command provides a convenient option to add project-to-project references. -ms.date: 10/28/2025 +ms.date: 09/15/2026 +ai-usage: ai-assisted --- # dotnet reference add @@ -17,7 +18,7 @@ ms.date: 10/28/2025 ## Synopsis ```dotnetcli -dotnet reference add reference [-f|--framework ] +dotnet reference add reference [--file ] [-f|--framework ] [--interactive] [--project ] dotnet reference add -h|--help @@ -60,6 +61,10 @@ There's no CLI command to add a reference to an assembly that isn't in a project ## Options +- **`--file `** + + Specifies the file-based app to add project references to. For example, specify `app.cs` to add `#:project` directives to a file-based app. Available starting with .NET 11. + - **`-f|--framework `** Adds project references only when targeting a specific [framework](../../standard/frameworks.md) using the TFM format. diff --git a/docs/core/tools/dotnet-sln.md b/docs/core/tools/dotnet-sln.md index afdd9b06dbd0c..c97a9080dad27 100644 --- a/docs/core/tools/dotnet-sln.md +++ b/docs/core/tools/dotnet-sln.md @@ -1,7 +1,8 @@ --- title: dotnet sln command -description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file. -ms.date: 10/28/2025 +ai-usage: ai-assisted +description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file or solution filter. +ms.date: 09/16/2026 --- # dotnet sln @@ -9,7 +10,7 @@ ms.date: 10/28/2025 ## Name -`dotnet sln` - Lists or modifies the projects in a .NET solution file, or migrates the file to an *.slnx* file. +`dotnet sln` - Lists or modifies the projects in a .NET solution file or solution filter, or migrates an *.sln* file to an *.slnx* file. ## Synopsis @@ -21,7 +22,7 @@ dotnet sln [command] -h|--help ## Description -The `dotnet sln` command provides a convenient way to list and modify projects in a solution file. +The `dotnet sln` command provides a convenient way to list and modify projects in a solution file or solution filter. ### Create a solution file @@ -48,13 +49,21 @@ dotnet new sln --output MySolution > [!NOTE] > In .NET 9 and earlier versions, `dotnet new sln` creates an *.sln* file instead of an *.slnx* file. +### Create a solution filter + +Starting with .NET 11, you can create a [solution filter](/visualstudio/msbuild/solution-filters) (*.slnf* file) with the `slnf` template: + +```dotnetcli +dotnet new slnf --name MyApp.slnf +``` + ## Arguments - **`SOLUTION_FILE`** - The solution file to use (either an *.sln* or *.slnx* file). + The solution file (*.sln* or *.slnx* file) or solution filter (*.slnf* file) to use. - If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. + If unspecified, the command searches the current directory for an *.sln*, *.slnx*, or *.slnf* file and, if it finds exactly one, uses that file. If multiple solution files or filters are found, the user is prompted to specify a file explicitly. If none are found, the command fails. ## Options @@ -108,13 +117,15 @@ dotnet sln add [-h|--help] - **`SOLUTION_FILE`** - The solution file to use (either an *.sln* or *.slnx* file). + The solution file (*.sln* or *.slnx* file) or solution filter (*.slnf* file) to use. + + If unspecified, the command searches the current directory for an *.sln*, *.slnx*, or *.slnf* file and, if it finds exactly one, uses that file. If multiple solution files or filters are found, the user is prompted to specify a file explicitly. If none are found, the command fails. - If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. + (Support for *.slnf* files was added in .NET 11.) - **`PROJECT_PATH`** - The path to the project or projects to add to the solution. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command. + The path to the project or projects to add to the solution or solution filter. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command. If `PROJECT_PATH` includes folders that contain the project folder, that portion of the path is used to create [solution folders](/visualstudio/ide/solutions-and-projects-in-visual-studio#solution-folder). For example, the following commands create a solution with `myapp` in solution folder `folder1/folder2`: @@ -153,13 +164,15 @@ dotnet sln [] remove [-h|--help] - **`SOLUTION_FILE`** - The solution file to use (either an *.sln* or *.slnx* file). + The solution file (*.sln* or *.slnx* file) or solution filter (*.slnf* file) to use. + + If unspecified, the command searches the current directory for an *.sln*, *.slnx*, or *.slnf* file and, if it finds exactly one, uses that file. If multiple solution files or filters are found, the user is prompted to specify a file explicitly. If none are found, the command fails. - If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. + (Support for *.slnf* files was added in .NET 11.) - **`PROJECT_PATH` or `PROJECT_NAME`** - The path to, or name of, the project or projects to remove from the solution. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command. + The path to, or name of, the project or projects to remove from the solution or solution filter. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command. If a project name is provided instead of a path, the project in the solution that matches the name, regardless of its path, is removed. If more than one matching project is found in the solution, the command errors out. Omit the project file extension in the name. (Support for removing projects by name was added in .NET 10.) @@ -200,6 +213,15 @@ dotnet sln [] migrate [-h|--help] dotnet sln todo.slnx list ``` +- Create a solution filter, add a project, list the projects, and remove the project: + + ```dotnetcli + dotnet new slnf --name MyApp.slnf + dotnet sln MyApp.slnf add src/Lib/Lib.csproj + dotnet sln MyApp.slnf list + dotnet sln MyApp.slnf remove src/Lib/Lib.csproj + ``` + - Add a C# project to a solution: ```dotnetcli diff --git a/docs/core/tools/dotnet-tool-exec.md b/docs/core/tools/dotnet-tool-exec.md index 2af3fdfe72552..f8da5ef79cc97 100644 --- a/docs/core/tools/dotnet-tool-exec.md +++ b/docs/core/tools/dotnet-tool-exec.md @@ -1,7 +1,8 @@ --- title: dotnet tool exec command description: The dotnet tool exec command downloads and invokes a .NET tool in one step without permanent installation. -ms.date: 09/06/2025 +ms.date: 09/15/2026 +ai-usage: ai-assisted --- # dotnet tool exec @@ -18,7 +19,7 @@ dotnet tool exec [@] [--allow-roll-forward] [-a|--arch ] [--add-source ] [--configfile ] [--disable-parallel] [--framework ] [--ignore-failed-sources] [--interactive] - [--no-http-cache] [--prerelease] [--source ] + [--no-http-cache] [--prerelease] [--source ] [-y|--yes] [-v|--verbosity ] [--] [...] @@ -81,6 +82,10 @@ This command also exists in two other forms for easier use Allows prerelease packages to be selected when resolving the version to install. +- **`-y|--yes`** + + Accepts all confirmation prompts, including the prompt to download and run the tool package. Use this option only with packages and package sources that you trust. Available starting with .NET 11. + - [!INCLUDE [source](includes/cli-tool-source.md)] - [!INCLUDE [verbosity](includes/cli-verbosity-normal.md)]