question

cw-4080 avatar image
0 Votes"
cw-4080 asked TianyuSun-MSFT edited

Setting Environment Variables in Visual Studio Launch Settings Using Host Environment Variable

We have a need to do something like the following with environment variables in our launchSettings.json file:

"SOME_ENV": "${env.SOME_HOST_ENV}/someVal"

When I get the environment variable at runtime, I get SOME_ENV = "${env.SOME_HOST_ENV}/someVal". Is this something that is possible with Visual Studio 2019 in a launchSettings.json file?

vs-generalvs-debugging
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered TianyuSun-MSFT edited

Hello @cw-4080 ,

Welcome to Microsoft Q&A forum.

I think this is not possible.

Not sure what you need, but maybe as a workaround, is it possible for you to get the host environment variable first in launchSettings.json file and then combine them in the codes to get some/other variables?

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.