dotnet-clean - Man Page

Cleans the output of a project.

dotnet clean

This article applies to: ✔️ .NET 6 and later versions

Synopsis

dotnet clean [<PROJECT>|<SOLUTION>|<FILE>] [--artifacts-path <ARTIFACTS_DIR>]
    [-c|--configuration <CONFIGURATION>]
    [-f|--framework <FRAMEWORK>] [--interactive]
    [--nologo] [-o|--output <OUTPUT_DIRECTORY>]
    [-r|--runtime <RUNTIME_IDENTIFIER>] [--tl:[auto|on|off]]
    [-v|--verbosity <LEVEL>]

dotnet clean -h|--help

Description

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

Arguments

PROJECT | SOLUTION | FILE

The project or solution or C# (file-based app) file to operate on. If a file isn’t specified, MSBuild searches the current directory for a project or solution.

Options

Examples

Info

2025-09-30 .NET Documentation