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
+7-7Lines changed: 7 additions & 7 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, solution, or file-based program and all of its dependencies.
12
+
`dotnet build` - Builds a project, solution, or file-based app and all of its dependencies.
13
13
14
14
## Synopsis
15
15
@@ -32,7 +32,7 @@ dotnet build -h|--help
32
32
33
33
## Description
34
34
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:
35
+
The `dotnet build` command builds the project, solution, or file-based app 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
37
- An executable that can be used to run the application.
38
38
- Symbol files used for debugging with a *.pdb* extension.
@@ -62,7 +62,7 @@ To produce a library, omit the `<OutputType>` property or change its value to `L
62
62
63
63
### MSBuild
64
64
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).
65
+
`dotnet build` uses MSBuild to build the project, solution, or file-based app. It supports both parallel and incremental builds. For more information, see [Incremental Builds](/visualstudio/msbuild/incremental-builds).
66
66
67
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.
68
68
@@ -77,13 +77,13 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev
77
77
78
78
`PROJECT | SOLUTION | FILE`
79
79
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.
80
+
The project or solution or C# (file-based app) file to build. If a file isn't specified, MSBuild searches the current directory for a project or solution.
81
81
82
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
83
84
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
85
86
-
-`FILE` is an argument added in .NET 10. 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).
86
+
-`FILE` is an argument added in .NET 10. The path and filename of a file-based app. File-based apps are contained within a single file that is 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).
87
87
88
88
## Options
89
89
@@ -180,13 +180,13 @@ The project or solution or C# (file-based program) file to publish. If a file is
180
180
dotnet build
181
181
```
182
182
183
-
- Build a file-based program:
183
+
- Build a file-based app:
184
184
185
185
```dotnetcli
186
186
dotnet build MyProject.cs
187
187
```
188
188
189
-
File-based program support was added in .NET SDK 10.0.100.
189
+
File-based app support was added in .NET SDK 10.0.100.
190
190
191
191
- Build a project and its dependencies using Release configuration:
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-clean.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,13 +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 publish. 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 app) file to clean. If a file isn't specified, MSBuild searches the current directory for a project or solution.
36
36
37
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
38
39
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
40
41
-
-`FILE` is an argument added in .NET 10. 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).
41
+
-`FILE` is an argument added in .NET 10. The path and filename of a file-based app. File-based apps are contained within a single file that is built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# apps](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
42
42
43
43
## Options
44
44
@@ -88,7 +88,7 @@ The project or solution or C# (file-based program) file to publish. If a file is
88
88
dotnet clean Program.cs.
89
89
```
90
90
91
-
File-based program support was added in .NET SDK 10.0.100.
91
+
File-based app support was added in .NET SDK 10.0.100.
92
92
93
93
- Clean a project built using the Release configuration:
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-publish.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
@@ -122,7 +122,7 @@ The project or solution or C# (file-based program) file to publish. If a file is
122
122
123
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 an argument added in .NET 10. 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).
125
+
-`FILE` is an argument added in .NET 10. The path and filename of a file-based app. File-based apps are contained within a single file that is built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# apps](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-restore.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,13 +88,13 @@ There are three specific settings that `dotnet restore` ignores:
88
88
89
89
`PROJECT | SOLUTION | FILE`
90
90
91
-
The project or solution or C# (file-based program) file to restore. If a file isn't specified, MSBuild searches the current directory for a project or solution.
91
+
The project or solution or C# (file-based app) file to restore. If a file isn't specified, MSBuild searches the current directory for a project or solution.
92
92
93
93
-`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.
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 an argument added in .NET 10. 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).
97
+
-`FILE` is an argument added in .NET 10. The path and filename of a file-based app. File-based apps are contained within a single file that is built and run without a corresponding project (`*.csproj`) file. For more information, see [Build file-based C# apps](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-run.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,19 @@ To run the application, the `dotnet run` command resolves the dependencies of th
83
83
84
84
-**`--file <FILE_PATH>`**
85
85
86
-
The path to the file-based program to run. This option can be passed as the first argument if there is no project in the current directory. For more information, see [Build file-based C# programs](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
86
+
The path to the file-based app to run. This option can be passed as the first argument if there is no project in the current directory. For more information, see [Build file-based C# apps](/dotnet/csharp/fundamentals/tutorials/file-based-programs).
87
+
88
+
On Unix, you can run file-based apps directly, using the source file name on the command line instead of `dotnet run`. First, ensure the file has execute permissions. Then, add a shebang line `#!` as the first line of the file, for example:
89
+
90
+
```csharp
91
+
#!/usr/bin/env dotnet run
92
+
```
93
+
94
+
Then you can run the file directly from the command line:
95
+
96
+
```bash
97
+
./ConsoleApp.cs
98
+
```
87
99
88
100
Introduced in .NET SDK 10.0.100.
89
101
@@ -167,13 +179,13 @@ The environment is constructed in the same order as this list, so the `-e|--envi
167
179
dotnet run
168
180
```
169
181
170
-
- Run the specified file-based program with arguments:
182
+
- Run the specified file-based app with arguments:
171
183
172
184
```dotnetcli
173
185
dotnet run ConsoleApp.cs -- arg1 arg2
174
186
```
175
187
176
-
File-based program support was added in .NET SDK 10.0.100.
188
+
File-based app support was added in .NET SDK 10.0.100.
0 commit comments