Skip to content

Commit 9b86391

Browse files
authored
dotnet sln updates for .slnf and removing by name (#45538)
1 parent fc0c030 commit 9b86391

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/core/tools/dotnet-sln.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: dotnet sln command
33
description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
4-
ms.date: 02/24/2025
4+
ms.date: 03/26/2025
55
---
66
# dotnet sln
77

@@ -80,9 +80,11 @@ dotnet sln list [-h|--help]
8080

8181
- **`SOLUTION_FILE`**
8282

83-
The solution file to use (either an *.sln* or *.slnx* file).
83+
The solution file (*.sln* or *.slnx* file) or [solution filter](/visualstudio/msbuild/solution-filters) (*.slnf* file) to use.
8484

85-
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.
85+
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.
86+
87+
(Support for *.slnf* files was added in .NET SDK 9.0.3xx.)
8688

8789
#### Options
8890

@@ -140,7 +142,7 @@ Removes a project or multiple projects from the solution file.
140142
#### Synopsis
141143

142144
```dotnetcli
143-
dotnet sln [<SOLUTION_FILE>] remove <PROJECT_PATH> [<PROJECT_PATH>...]
145+
dotnet sln [<SOLUTION_FILE>] remove <PROJECT_PATH|PROJECT_NAME> [<PROJECT_PATH|PROJECT_NAME>...]
144146
dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
145147
```
146148

@@ -152,9 +154,11 @@ dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
152154

153155
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.
154156

155-
- **`PROJECT_PATH`**
157+
- **`PROJECT_PATH` or `PROJECT_NAME`**
158+
159+
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.
156160

157-
The path to 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.
161+
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.)
158162

159163
#### Options
160164

0 commit comments

Comments
 (0)