Skip to content

Commit b0fa169

Browse files
authored
add file-based app options for dotnet-run
1 parent e5be715 commit b0fa169

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

docs/core/tools/dotnet-run.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: dotnet run command
33
description: The dotnet run command provides a convenient option to run your application from the source code.
4-
ms.date: 03/26/2025
4+
ms.date: 09/24/2025
55
---
66
# dotnet run
77

8-
**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions
8+
**This article applies to:** ✔️ .NET Core 6 and later versions
99

1010
## Name
1111

@@ -14,7 +14,7 @@ ms.date: 03/26/2025
1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet run [-a|--arch <ARCHITECTURE>] [-c|--configuration <CONFIGURATION>]
17+
dotnet run [<applicationArguments>] [-a|--arch <ARCHITECTURE>] [-c|--configuration <CONFIGURATION>]
1818
[-e|--environment <KEY=VALUE>]
1919
[-f|--framework <FRAMEWORK>] [--force] [--interactive]
2020
[--launch-profile <NAME>] [--no-build]
@@ -53,6 +53,12 @@ To run the application, the `dotnet run` command resolves the dependencies of th
5353

5454
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
5555

56+
## Arguments
57+
58+
`<applicationArguments>`
59+
60+
Arguments passed to the application that is being run.
61+
5662
## Options
5763

5864
- **`--`**
@@ -75,6 +81,10 @@ To run the application, the `dotnet run` command resolves the dependencies of th
7581

7682
Builds and runs the app using the specified [framework](../../standard/frameworks.md). The framework must be specified in the project file.
7783

84+
- **`--file <FILE_PATH>`**
85+
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.
87+
7888
- **`--force`**
7989

8090
Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file.
@@ -155,6 +165,12 @@ The environment is constructed in the same order as this list, so the `-e|--envi
155165
dotnet run
156166
```
157167

168+
- Run the specified file-based app:
169+
170+
```dotnetcli
171+
dotnet run ConsoleApp.cs -- arg1 arg2
172+
```
173+
158174
- Run the specified project:
159175

160176
```dotnetcli

0 commit comments

Comments
 (0)