Skip to content

Add dotnet new sln examples #29528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions docs/core/tools/dotnet-sln.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
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: 12/07/2020
ms.date: 05/18/2022
---
# dotnet sln

Expand All @@ -23,12 +23,28 @@ dotnet sln [command] -h|--help

The `dotnet sln` command provides a convenient way to list and modify projects in a solution file.

To use the `dotnet sln` command, the solution file must already exist. If you need to create one, use the [dotnet new](dotnet-new.md) command, as in the following example:
### Create a solution file

To use the `dotnet sln` command, the solution file must already exist. If you need to create one, use the [dotnet new](dotnet-new.md) command with the `sln` template name.

The following example creates a *.sln* file in the current folder, with the same name as the folder:

```dotnetcli
dotnet new sln
```

The following example creates a *.sln* file in the current folder, with the specified file name:

```dotnetcli
dotnet new sln --name MySolution
```

The following example creates a *.sln* file in the specified folder, with the same name as the folder:

```dotnetcli
dotnet new sln --output MySolution
```

## Arguments

- **`SOLUTION_FILE`**
Expand Down