1dotnet clean command(1)            .NET Core           dotnet clean command(1)
2
3
4

dotnet clean

6       This topic applies to: ✓ .NET Core 1.x SDK and later versions
7

NAME

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

SYNOPSIS

12              dotnet clean [<PROJECT>|<SOLUTION>] [-c|--configuration] [-f|--framework] [--interactive]
13                  [--nologo] [-o|--output] [-r|--runtime] [-v|--verbosity]
14              dotnet clean [-h|--help]
15

DESCRIPTION

17       The dotnet clean command cleans the output of the previous build.  It’s
18       implemented as an MSBuild target, so the project is evaluated when  the
19       command is run.  Only the outputs created during the build are cleaned.
20       Both intermediate (obj) and final output (bin) folders are cleaned.
21
22   Arguments
23       PROJECT | SOLUTION
24
25       The MSBuild project or solution to clean.  If  a  project  or  solution
26       file  is  not specified, MSBuild searches the current working directory
27       for a file that has a file extension that ends in proj or sln, and uses
28       that file.
29

OPTIONS

31       · -c|--configuration {Debug|Release}
32
33         Defines  the  build configuration.  The default value is Debug.  This
34         option is only required when cleaning  if  you  specified  it  during
35         build time.
36
37       · -f|--framework <FRAMEWORK>
38
39         The  framework  that was specified at build time.  The framework must
40         be defined in the project file.  If you specified  the  framework  at
41         build time, you must specify the framework when cleaning.
42
43       · -h|--help
44
45         Prints out a short help for the command.
46
47       · --interactive
48
49         Allows  the  command  to stop and wait for user input or action.  For
50         example, to complete authentication.  Available since .NET  Core  3.0
51         SDK.
52
53       · --nologo
54
55         Doesn’t  display the startup banner or the copyright message.  Avail‐
56         able since .NET Core 3.0 SDK.
57
58       · -o|--output <OUTPUT_DIRECTORY>
59
60         The directory that contains the build artifacts  to  clean.   Specify
61         the  -f|--framework  <FRAMEWORK>  switch  with  the  output directory
62         switch if you specified the framework when the project was built.
63
64       · -r|--runtime <RUNTIME_IDENTIFIER>
65
66         Cleans the output folder of the specified runtime.  This is used when
67         a self-contained deployment was created.  Option available since .NET
68         Core 2.0 SDK.
69
70       · -v|--verbosity <LEVEL>
71
72         Sets the MSBuild verbosity level.  Allowed values are q[uiet], m[ini‐
73         mal], n[ormal], d[etailed], and diag[nostic].  The default is normal.
74

EXAMPLES

76       · Clean a default build of the project:
77
78                dotnet clean
79
80       · Clean a project built using the Release configuration:
81
82                dotnet clean --configuration Release
83
84
85
86                                                       dotnet clean command(1)
Impressum