dotnet / dotnet/project-system

Launch profile environment variables are not available for substitution within the same launch profile

Open
#8,191 2 comments 0 reactions 1 assignee Claimed by @tmeschter View on GitHub
Feature-Debugging Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

Stems from https://developercommunity.visualstudio.com/t/Launch-profile-environment-variable-prob/10042433 ([AB#1540437](https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems/edit/1540437))

## Steps to reproduce

1. Create a launch profile
2. Add an environment variable (e.g. `FOO`)
3. Attempt to use that variable in another field such as the command line (e.g. `%FOO%`)

## Expected behaviour

The environment variable is substituted in the other field.

## Actual behaviour

No substitution occurs.

![image](https://user-images.githubusercontent.com/350947/169427986-73e804ac-52cd-4e73-b3f9-74495f015852.png)

![image](https://user-images.githubusercontent.com/350947/169428091-9a4b9862-fcf0-4462-9983-a1440799a1f2.png)

## Analysis

Our current environment variable substitution uses the environment variables of `devenv.exe` only. Those specified in the launch profile itself are not considered.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.