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.
Copy file name to clipboardexpand all lines: docs/core/tools/dotnet-sln.md
+10-6
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: dotnet sln command
3
3
description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
4
-
ms.date: 02/24/2025
4
+
ms.date: 03/26/2025
5
5
---
6
6
# dotnet sln
7
7
@@ -80,9 +80,11 @@ dotnet sln list [-h|--help]
80
80
81
81
-**`SOLUTION_FILE`**
82
82
83
-
The solution file to use (either an *.sln* or *.slnx* file).
83
+
The solution file (*.sln* or *.slnx* file) or [solution filter](/visualstudio/msbuild/solution-filters) (*.slnf* file) to use.
84
84
85
-
If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails.
85
+
If unspecified, the command searches the current directory for an *.sln*, *.slnx*, or *.slnf* file and, if it finds exactly one, uses that file. If multiple solution files or filters are found, the user is prompted to specify a file explicitly. If none are found, the command fails.
86
+
87
+
(Support for *.slnf* files was added in .NET SDK 9.0.3xx.)
86
88
87
89
#### Options
88
90
@@ -140,7 +142,7 @@ Removes a project or multiple projects from the solution file.
If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails.
154
156
155
-
-**`PROJECT_PATH`**
157
+
-**`PROJECT_PATH` or `PROJECT_NAME`**
158
+
159
+
The path to, or name of, the project or projects to remove from the solution. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command.
156
160
157
-
The path to the project or projects to remove from the solution. Unix/Linux shell [globbing pattern](https://en.wikipedia.org/wiki/Glob_(programming)) expansions are processed correctly by the `dotnet sln` command.
161
+
If a project name is provided instead of a path, the project in the solution that matches the name, regardless of its path, is removed. If more than one matching project is found in the solution, the command errors out. Omit the project file extension in the name. (Support for removing projects by name was added in .NET 10.)
0 commit comments