Add documentation for new -e
/--environment
CLI argument for dotnet run
#44867
Labels
-e
/--environment
CLI argument for dotnet run
#44867
Type of issue
Missing information
Description
In 9.0.200 we added a new argument to the
run
command to allow explicitly setting environment variables in the process that will be run, as opposed to applying them to the .NET CLI and the process that will be run.We need to document this argument, as well as have a section describing the way that environment variables are passed to the application that is launched.
The short version of how env variables are applied is that there are four mechanisms that can apply env variables to an application launched by
dotnet run
:[env:key=value]
- these apply to the entiredotnet run
process, not just the project being run bydotnet run
environmentVariables
from the chosen launch profile (-lp
) in the project'slaunchSettings.json
if any - these apply to the project being run bydotnet run
-e
/--environment
CLI option values - these apply to the project being run bydotnet run
The environment is constructed in this same order as well, so the
-e
option has the highest-precedence.Page URL
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/tools/dotnet-run.md
Document Version Independent Id
7e78f9f5-f77c-828d-ef76-8ef8593d5803
Article author
@tdykstra
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: