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] [-o|--output] [-r|--runtime] [-v|--verbosity]
13              dotnet clean [-h|--help]
14

DESCRIPTION

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

OPTIONS

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

EXAMPLES

70       · Clean a default build of the project:
71
72                dotnet clean
73
74       · Clean a project built using the Release configuration:
75
76                dotnet clean --configuration Release
77
78
79
80                                                       dotnet clean command(1)
Impressum