Allow specifying environment variables in Exec Task
See original GitHub issueThe Exec Task currently doesn’t allow specifying environment variables which would be set for the to invoked process.
Example use case
The SDK currently defines a Run
target which is used by VS to F5 an application. The properties used in the Run
target are RunCommand
, RunArguments
and RunWorkingDirectory
: https://github.com/dotnet/sdk/blob/3ed908ee77c592bae787ac78f466c3bc0581970a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L757.
If the Exec Task would allow specifying environment variables we could add a RunEnvironmentVariables
property which would remove the need for an extra launchSettings.json file: https://github.com/dotnet/runtime/blob/817ebcaeb617813f98650e78c14e76bbd8b733b0/eng/testing/launchSettings.json#L14-L16.
Other references
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Allow specifying environment variables in Exec Task #5308
The Exec Task currently doesn't allow specifying environment variables which would be set for the to invoked process.
Read more >How can I Pass environment to gradle exec
I want to have execute commands using different variables for configurations. In ant, I'd set my properties and then pass them to exec...
Read more >Exec Task - MSBuild
Learn to use the MSBuild Exec task to run a specified program or command by using the specified arguments.
Read more >Exec Task
It is possible to specify environment variables to pass to the system command via nested <env> elements. Attribute, Description, Required. key, The name...
Read more >Environment and Metadata
The --env option on the run/exec/shell commands allows you to specify environment variables as NAME=VALUE pairs: $ apptainer run env.sif Hello $ apptainer ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Exec
does support this.Example from the Mac I’m on right now:
@ghogen, I suspect this is an example of the
ToolTask
-derived task docs not being sufficiently clear that they expose theToolTask
parameters. We have a link in each of them pointing to the base class, but is there a way to define a central snippet that could be included in each doc page?@hairlesshobo would MicrosoftDocs/visualstudio-docs#5783 help?