Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into live #45558

Merged
merged 3 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions docs/core/tools/dotnet-run.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: dotnet run command
description: The dotnet run command provides a convenient option to run your application from the source code.
ms.date: 11/27/2023
ms.date: 03/26/2025
---
# dotnet run

Expand All @@ -15,6 +15,7 @@ ms.date: 11/27/2023

```dotnetcli
dotnet run [-a|--arch <ARCHITECTURE>] [-c|--configuration <CONFIGURATION>]
[-e|--environment <KEY=VALUE>]
[-f|--framework <FRAMEWORK>] [--force] [--interactive]
[--launch-profile <NAME>] [--no-build]
[--no-dependencies] [--no-launch-profile] [--no-restore]
Expand Down Expand Up @@ -42,7 +43,7 @@ The `dotnet run` command is used in the context of projects, not built assemblie
dotnet myapp.dll
```

For more information on the `dotnet` driver, see the [.NET Command Line Tools (CLI)](index.md) topic.
For more information on the `dotnet` driver, see [.NET CLI overview](index.md).

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.

Expand All @@ -62,6 +63,14 @@ To run the application, the `dotnet run` command resolves the dependencies of th

[!INCLUDE [configuration](../../../includes/cli-configuration.md)]

- **`-e|--environment <KEY=VALUE>`**

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.

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).

(This option was added in .NET SDK 9.0.200.)

- **`-f|--framework <FRAMEWORK>`**

Builds and runs the app using the specified [framework](../../standard/frameworks.md). The framework must be specified in the project file.
Expand Down Expand Up @@ -127,6 +136,17 @@ To run the application, the `dotnet run` command resolves the dependencies of th

[!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)]

## Environment variables

There are four mechanisms by which environment variables can be applied to the launched application:

1. Ambient environment variables from the operating system when the command is run.
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`.
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`.
1. `-e|--environment` CLI option values (added in .NET SDK version 9.0.200). These apply to the project being run by `dotnet run`.

The environment is constructed in the same order as this list, so the `-e|--environment` option has the highest precedence.

## Examples

- Run the project in the current directory:
Expand Down
16 changes: 10 additions & 6 deletions docs/core/tools/dotnet-sln.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: dotnet sln command
description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
ms.date: 02/24/2025
ms.date: 03/26/2025
---
# dotnet sln

Expand Down Expand Up @@ -80,9 +80,11 @@ dotnet sln list [-h|--help]

- **`SOLUTION_FILE`**

The solution file to use (either an *.sln* or *.slnx* file).
The solution file (*.sln* or *.slnx* file) or [solution filter](/visualstudio/msbuild/solution-filters) (*.slnf* file) to use.

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.
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.

(Support for *.slnf* files was added in .NET SDK 9.0.3xx.)

#### Options

Expand Down Expand Up @@ -140,7 +142,7 @@ Removes a project or multiple projects from the solution file.
#### Synopsis

```dotnetcli
dotnet sln [<SOLUTION_FILE>] remove <PROJECT_PATH> [<PROJECT_PATH>...]
dotnet sln [<SOLUTION_FILE>] remove <PROJECT_PATH|PROJECT_NAME> [<PROJECT_PATH|PROJECT_NAME>...]
dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
```

Expand All @@ -152,9 +154,11 @@ dotnet sln [<SOLUTION_FILE>] remove [-h|--help]

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.

- **`PROJECT_PATH`**
- **`PROJECT_PATH` or `PROJECT_NAME`**

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.

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.
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.)

#### Options

Expand Down
6 changes: 2 additions & 4 deletions docs/welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ You can build many types of apps with .NET, such as cloud, IoT, and games, using
For news about .NET, check the following blogs:

- [.NET Blog](https://devblogs.microsoft.com/dotnet/)
- [ASP.NET Blog](https://devblogs.microsoft.com/aspnet/)
- [The Visual Studio Blog](https://devblogs.microsoft.com/visualstudio/)
- [The Visual Basic Team](https://devblogs.microsoft.com/vbteam/)

Also follow the latest .NET events:

- [.NET Conf](https://www.dotnetconf.net/)
- [Microsoft Ignite](https://www.microsoft.com/ignite)
- [Microsoft Build](https://www.microsoft.com/build)
- [Microsoft Ignite](https://ignite.microsoft.com/)
- [Microsoft Build](https://build.microsoft.com/)

For information about the latest features added to the .NET implementations and supported languages, see the following articles:

Expand Down
Loading