You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-build.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.date: 09/24/2025
9
9
10
10
## Name
11
11
12
-
`dotnet build` - Builds a project and all of its dependencies.
12
+
`dotnet build` - Builds a project, solution, or file-based program and all of its dependencies.
13
13
14
14
## Synopsis
15
15
@@ -32,16 +32,14 @@ dotnet build -h|--help
32
32
33
33
## Description
34
34
35
-
The `dotnet build` command builds the projectand its dependencies into a set of binaries. The binaries include the project's code in Intermediate Language (IL) files with a *.dll* extension. Depending on the project type and settings, other files may be included, such as:
35
+
The `dotnet build` command builds the project, solution, or file-based program and its dependencies into a set of binaries. The binaries include the project's code in Intermediate Language (IL) files with a *.dll* extension. Depending on the project type and settings, other files may be included, such as:
36
36
37
-
- An executable that can be used to run the application, if the project type is an executable targeting .NET Core 3.0 or later.
37
+
- An executable that can be used to run the application.
38
38
- Symbol files used for debugging with a *.pdb* extension.
39
39
- A *.deps.json* file, which lists the dependencies of the application or library.
40
40
- A *.runtimeconfig.json* file, which specifies the shared runtime and its version for an application.
41
41
- Other libraries that the project depends on (via project references or NuGet package references).
42
42
43
-
For executable projects targeting versions earlier than .NET Core 3.0, library dependencies from NuGet are typically NOT copied to the output folder. They're resolved from the NuGet global packages folder at run time. With that in mind, the product of `dotnet build` isn't ready to be transferred to another machine to run. To create a version of the application that can be deployed, you need to publish it (for example, with the [dotnet publish](dotnet-publish.md) command). For more information, see [.NET Application Deployment](../deploying/index.md).
44
-
45
43
For executable projects targeting .NET Core 3.0 and later, library dependencies are copied to the output folder. This means that if there isn't any other publish-specific logic (such as Web projects have), the build output should be deployable.
46
44
47
45
### Implicit restore
@@ -64,7 +62,7 @@ To produce a library, omit the `<OutputType>` property or change its value to `L
64
62
65
63
### MSBuild
66
64
67
-
`dotnet build` uses MSBuild to build the project, so it supports both parallel and incremental builds. For more information, see [Incremental Builds](/visualstudio/msbuild/incremental-builds).
65
+
`dotnet build` uses MSBuild to build the project, solution, or file-based program. It supports both parallel and incremental builds. For more information, see [Incremental Builds](/visualstudio/msbuild/incremental-builds).
68
66
69
67
In addition to its options, the `dotnet build` command accepts MSBuild options, such as `-p` for setting properties or `-l` to define a logger. For more information about these options, see the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference). Or you can also use the [dotnet msbuild](dotnet-msbuild.md) command.
70
68
@@ -79,7 +77,13 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev
79
77
80
78
`PROJECT | SOLUTION | FILE`
81
79
82
-
The project or solution or C# (file-based program) file to build. If a file isn't specified, MSBuild searches the current directory for a project or solution.
80
+
The project or solution or C# (file-based program) file to publish. If a file isn't specified, MSBuild searches the current directory for a project or solution.
81
+
82
+
*`PROJECT` is the path and filename of a C#, F#, or Visual Basic project file, or the path to a directory that contains a C#, F#, or Visual Basic project file.
83
+
84
+
*`SOLUTION` is the path and filename of a solution file (*.sln* or *.slnx* extension), or the path to a directory that contains a solution file.
85
+
86
+
*`FILE` is the path and filename of a file-based program. Files-based programs are contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
83
87
84
88
## Options
85
89
@@ -176,7 +180,7 @@ The project or solution or C# (file-based program) file to build. If a file isn'
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-clean.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: dotnet clean command
3
3
description: The dotnet clean command cleans the current directory.
4
-
ms.date: 09/23/2025
4
+
ms.date: 09/24/2025
5
5
---
6
6
# dotnet clean
7
7
@@ -32,7 +32,13 @@ The `dotnet clean` command cleans the output of the previous build. It's impleme
32
32
33
33
`PROJECT | SOLUTION | FILE`
34
34
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.
35
+
The project or solution or C# (file-based program) file to publish. If a file isn't specified, MSBuild searches the current directory for a project or solution.
36
+
37
+
*`PROJECT` is the path and filename of a C#, F#, or Visual Basic project file, or the path to a directory that contains a C#, F#, or Visual Basic project file.
38
+
39
+
*`SOLUTION` is the path and filename of a solution file (*.sln* or *.slnx* extension), or the path to a directory that contains a solution file.
40
+
41
+
*`FILE` is the path and filename of a file-based program. Files-based programs are contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
36
42
37
43
## Options
38
44
@@ -76,7 +82,7 @@ The project or solution or C# (file-based program) file to operate on. If a file
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-publish.md
+4-10Lines changed: 4 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,13 +116,13 @@ For more information, see the following resources:
116
116
117
117
`PROJECT | SOLUTION | FILE`
118
118
119
-
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.
119
+
The project or solution or C# (file-based program) file to publish. If a file isn't specified, MSBuild searches the current directory for a project or solution.
120
120
121
-
*`PROJECT` is the path and filename of a C#, F#, or Visual Basic project file, or the path to a directory that contains a C#, F#, or Visual Basic project file. If the directory is not specified, it defaults to the current directory.
121
+
*`PROJECT` is the path and filename of a C#, F#, or Visual Basic project file, or the path to a directory that contains a C#, F#, or Visual Basic project file.
122
122
123
-
*`SOLUTION` is the path and filename of a solution file (*.sln* or *.slnx* extension), or the path to a directory that contains a solution file. If the directory is not specified, it defaults to the current directory.
123
+
*`SOLUTION` is the path and filename of a solution file (*.sln* or *.slnx* extension), or the path to a directory that contains a solution file.
124
124
125
-
*`FILE` is the path and filename of a file-based app. Files-based apps are programs contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
125
+
*`FILE` is the path and filename of a file-based program. Files-based programs are contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
126
126
127
127
## Options
128
128
@@ -188,12 +188,6 @@ The project or solution or C# (file-based program) file to operate on. If a file
188
188
189
189
If you specify a relative path when publishing a solution, all output for all projects goes into the specified folder relative to the current working directory. To make publish output go to separate folders for each project, specify a relative path by using the msbuild `PublishDir` property instead of the `--output` option. For example, `dotnet publish -p:PublishDir=.\publish` sends publish output for each project to a `publish` folder under the folder that contains the project file.
190
190
191
-
- .NET Core 2.x SDK
192
-
193
-
If you specify a relative path when publishing a project, the generated output directory is relative to the project file location, not to the current working directory.
194
-
195
-
If you specify a relative path when publishing a solution, each project's output goes into a separate folder relative to the project file location. If you specify an absolute path when publishing a solution, all publish output for all projects goes into the specified folder.
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-restore.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ The project or solution or C# (file-based program) file to restore. If a file is
94
94
95
95
*`SOLUTION` is the path and filename of a solution file (*.sln* or *.slnx* extension), or the path to a directory that contains a solution file. If the directory is not specified, it defaults to the current directory.
96
96
97
-
*`FILE` is the path and filename of a file-based app. Files-based apps are programs contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
97
+
*`FILE` is the path and filename of a file-based program. File-based programs are contained within a single `*.cs` file that are built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
0 commit comments