|
| 1 | +--- |
| 2 | +title: dotnet-sln command | Microsoft Docs |
| 3 | +description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file. |
| 4 | +keywords: dotnet-run, CLI, CLI command, .NET Core |
| 5 | +author: spboyer |
| 6 | +ms.author: mairaw |
| 7 | +ms.date: 02/06/2017 |
| 8 | +ms.topic: article |
| 9 | +ms.prod: .net-core |
| 10 | +ms.technology: dotnet-cli |
| 11 | +ms.devlang: dotnet |
| 12 | +ms.assetid: e5a72d3e-c14b-4b0a-a978-c5e54a0988c6 |
| 13 | +--- |
| 14 | +# dotnet-sln |
| 15 | + |
| 16 | +[!INCLUDE[preview-warning](../../../includes/warning.md)] |
| 17 | + |
| 18 | +## Name |
| 19 | + |
| 20 | +`dotnet-sln` - Modifies a .NET Core solution file. |
| 21 | + |
| 22 | +## Synopsis |
| 23 | + |
| 24 | +``` |
| 25 | +dotnet sln [<SLN_NAME>] add <project> <project> |
| 26 | +dotnet sln [<SLN_NAME>] add **/** |
| 27 | +dotnet sln [<SLN_NAME>] remove <project> <project> |
| 28 | +dotnet sln [<SLN_NAME>] remove **/** |
| 29 | +dotnet sln [<SLN_NAME>] list |
| 30 | +dotnet sln [-h|--help] |
| 31 | +``` |
| 32 | + |
| 33 | +## Description |
| 34 | + |
| 35 | +The `dotnet sln` command provides a convenient way to add, remove and list projects in a solution file. |
| 36 | + |
| 37 | +## Commands |
| 38 | + |
| 39 | +`add <project>` |
| 40 | + |
| 41 | +`add **/*` |
| 42 | + |
| 43 | +Adds a project or multiple projects to the solution file. Glob pattern is supported on Unix/Linux based terminals. |
| 44 | + |
| 45 | +`remove <project>` |
| 46 | + |
| 47 | +`remove **/*` |
| 48 | + |
| 49 | +Remove a project or multiple projects from the solution file. Glob pattern is supported on Unix/Linux based terminals. |
| 50 | + |
| 51 | +`list` |
| 52 | + |
| 53 | +List all projects in a solution file. |
| 54 | + |
| 55 | +## Arguments |
| 56 | + |
| 57 | +`SLN_NAME` |
| 58 | + |
| 59 | +Solution file to use. If not specified, the command will search the current directory for one. If there are multiple solution files in the directory; one must be specified. |
| 60 | + |
| 61 | +## Options |
| 62 | + |
| 63 | +`-h|--help` |
| 64 | + |
| 65 | +Prints out a short help for the command. |
| 66 | + |
| 67 | +## Examples |
| 68 | + |
| 69 | +Add a project to a solution: |
| 70 | + |
| 71 | +`dotnet sln todo.sln add todo-app/todo-app.csproj` |
| 72 | + |
| 73 | +Add a project to the solution in the current directory: |
| 74 | + |
| 75 | +`dotnet sln add todo-app.csproj` |
| 76 | + |
| 77 | +Remove a project from a solution: |
| 78 | + |
| 79 | +`dotnet sln todo.sln remove todo-app/todo-app.csproj` |
| 80 | + |
| 81 | +Add multiple projects to a solution using globbing pattern: |
| 82 | + |
| 83 | +`dotnet sln add **/**/*.fsproj` |
0 commit comments