Skip to content

Commit e5be715

Browse files
authored
add file based command for dotnet clean
1 parent 9907208 commit e5be715

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/core/tools/dotnet-clean.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: dotnet clean command
33
description: The dotnet clean command cleans the current directory.
4-
ms.date: 02/14/2020
4+
ms.date: 09/23/2025
55
---
66
# dotnet clean
77

8-
**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions
8+
**This article applies to:** ✔️ .NET 6 and later versions
99

1010
## Name
1111

@@ -14,7 +14,7 @@ ms.date: 02/14/2020
1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet clean [<PROJECT>|<SOLUTION>] [--artifacts-path <ARTIFACTS_DIR>]
17+
dotnet clean [<PROJECT>|<SOLUTION>|<FILE>] [--artifacts-path <ARTIFACTS_DIR>]
1818
[-c|--configuration <CONFIGURATION>]
1919
[-f|--framework <FRAMEWORK>] [--interactive]
2020
[--nologo] [-o|--output <OUTPUT_DIRECTORY>]
@@ -30,9 +30,9 @@ The `dotnet clean` command cleans the output of the previous build. It's impleme
3030

3131
## Arguments
3232

33-
`PROJECT | SOLUTION`
33+
`PROJECT | SOLUTION | FILE`
3434

35-
The MSBuild project or solution to clean. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in *proj* or *sln*, and uses that file.
35+
The project or solution or C# (file-based program) file to operate on. If a file isn't specified, MSBuild searches the current directory for a project or solution.
3636

3737
## Options
3838

@@ -76,6 +76,12 @@ The MSBuild project or solution to clean. If a project or solution file is not s
7676
dotnet clean
7777
```
7878

79+
* Clean a project in a specified file:
80+
81+
```dotnetcli
82+
dotnet clean Program.cs.
83+
```
84+
7985
* Clean a project built using the Release configuration:
8086

8187
```dotnetcli

0 commit comments

Comments
 (0)