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
@@ -42,7 +43,7 @@ The `dotnet run` command is used in the context of projects, not built assemblie
42
43
dotnet myapp.dll
43
44
```
44
45
45
-
For more information on the `dotnet` driver, see the [.NET Command Line Tools (CLI)](index.md) topic.
46
+
For more information on the `dotnet` driver, see [.NET CLI overview](index.md).
46
47
47
48
To run the application, the `dotnet run` command resolves the dependencies of the application that are outside of the shared runtime from the NuGet cache. Because it uses cached dependencies, it's not recommended to use `dotnet run` to run applications in production. Instead, [create a deployment](../deploying/index.md) using the [`dotnet publish`](dotnet-publish.md) command and deploy the published output.
48
49
@@ -62,6 +63,14 @@ To run the application, the `dotnet run` command resolves the dependencies of th
Sets the specified environment variable in the process that will be run by the command. The specified environment variable is *not* applied to the `dotnet run` process.
69
+
70
+
Environment variables passed through this option take precedence over ambient environment variables, System.CommandLine `env` directives, and `environmentVariables` from the chosen launch profile. For more information, see [Environment variables](#environment-variables).
71
+
72
+
(This option was added in .NET SDK 9.0.200.)
73
+
65
74
-**`-f|--framework <FRAMEWORK>`**
66
75
67
76
Builds and runs the app using the specified [framework](../../standard/frameworks.md). The framework must be specified in the project file.
@@ -127,6 +136,17 @@ To run the application, the `dotnet run` command resolves the dependencies of th
There are four mechanisms by which environment variables can be applied to the launched application:
142
+
143
+
1. Ambient environment variables from the operating system when the command is run.
144
+
1. System.CommandLine `env` directives, like `[env:key=value]`. These apply to the entire `dotnet run` process, not just the project being run by `dotnet run`.
145
+
1.`environmentVariables` from the chosen launch profile (`-lp`) in the project's [launchSettings.json file](/aspnet/core/fundamentals/environments#lsj), if any. These apply to the project being run by `dotnet run`.
146
+
1.`-e|--environment` CLI option values (added in .NET SDK version 9.0.200). These apply to the project being run by `dotnet run`.
147
+
148
+
The environment is constructed in the same order as this list, so the `-e|--environment` option has the highest precedence.
0 commit comments