1dotnet-clean(1)               .NET Documentation               dotnet-clean(1)
2
3
4

dotnet clean

6       This article applies to: ✔️ .NET Core 3.1 SDK and later versions
7

NAME

9       dotnet-clean - Cleans the output of a project.
10

SYNOPSIS

12              dotnet clean [<PROJECT>|<SOLUTION>] [-c|--configuration <CONFIGURATION>]
13                  [-f|--framework <FRAMEWORK>] [--interactive]
14                  [--nologo] [-o|--output <OUTPUT_DIRECTORY>]
15                  [-r|--runtime <RUNTIME_IDENTIFIER>] [-v|--verbosity <LEVEL>]
16
17              dotnet clean -h|--help
18

DESCRIPTION

20       The dotnet clean command cleans the output of the previous build.  It’s
21       implemented as an MSBuild target, so the project is evaluated when  the
22       command is run.  Only the outputs created during the build are cleaned.
23       Both intermediate (obj) and final output (bin) folders are cleaned.
24

ARGUMENTS

26       PROJECT | SOLUTION
27
28       The MSBuild project or solution to clean.  If  a  project  or  solution
29       file  is  not specified, MSBuild searches the current working directory
30       for a file that has a file extension that ends in proj or sln, and uses
31       that file.
32

OPTIONS

34-c|--configuration <CONFIGURATION>
35
36         Defines  the  build  configuration.  The default for most projects is
37         Debug, but you can override the build configuration settings in  your
38         project.  This option is only required when cleaning if you specified
39         it during build time.
40
41-f|--framework <FRAMEWORK>
42
43         The framework that was specified at build time.  The  framework  must
44         be  defined  in  the project file.  If you specified the framework at
45         build time, you must specify the framework when cleaning.
46
47-?|-h|--help
48
49         Prints out a description of how to use the command.
50
51--interactive
52
53         Allows the command to stop and wait for user input  or  action.   For
54         example,  to  complete authentication.  Available since .NET Core 3.0
55         SDK.
56
57--nologo
58
59         Doesn’t display the startup banner or the copyright message.
60
61-o|--output <OUTPUT_DIRECTORY>
62
63         The directory that contains the build artifacts  to  clean.   Specify
64         the  -f|--framework  <FRAMEWORK>  switch  with  the  output directory
65         switch if you specified the framework when the project was built.
66
67-r|--runtime <RUNTIME_IDENTIFIER>
68
69         Cleans the output folder of the specified runtime.  This is used when
70         a self-contained deployment was created.
71
72-v|--verbosity <LEVEL>
73
74         Sets the verbosity level of the command.  Allowed values are q[uiet],
75         m[inimal], n[ormal], d[etailed], and diag[nostic].   The  default  is
76         normal.    For  more  information,  see  <xref:Microsoft.Build.Frame‐
77         work.LoggerVerbosity>.
78

EXAMPLES

80       • Clean a default build of the project:
81
82                dotnet clean
83
84       • Clean a project built using the Release configuration:
85
86                dotnet clean --configuration Release
87
88
89
90                                  2022-10-10                   dotnet-clean(1)
Impressum