Environment variables in launch.json is not processing ${auto-detect-url}
See original GitHub issueFrom @corretge on November 29, 2017 8:49
When I try to put a launch variable in launch.json
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ENV_GLOBAL_CURRENT_URL" : "${auto-detect-url}"
}
I get this value:
"${auto-detect-url}"
instead
"http://localhost:5000"
- VSCode Version: 1.18.1
- OS Version: Windows 10
Steps to Reproduce:
- Create a C# project
- Set environment variables for a debug configuration as explained at begin
- Add Environment.GetEnvironmentVariable(“ENV_GLOBAL_CURRENT_URL”)
- Debug until this instruction
Copied from original issue: Microsoft/vscode#39294
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Environment variables in launch.json is not processing ${auto ...
When I try to put a launch variable in launch.json "env": ... is not processing ${auto-detect-url} OmniSharp/omnisharp-vscode#1933.
Read more >How do I add environment variables to launch.json in VSCode
You can add env variables by using the env property in your launch.json file or by using the envFile property with the value...
Read more >Debugging in Visual Studio Code
VS Code will try to automatically detect your debug environment, but if this fails, you will have to choose it manually: debug environment...
Read more >launchSettings.json - Visual Studio for Mac - Microsoft Learn
In this article. Update the start configuration by using Visual Studio for Mac; Configure environment variables; Configure the start URL.
Read more >VS Code | Build, Run and Debug in C++ - GeeksforGeeks
json file. cwd: denotes current working directory. Note that all the addresses in launch.json file are in general form, they are not specific...
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 FreeTop 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
Top GitHub Comments
Thanks @corretge, this isn’t something that is possible. The debugger doesn’t know the value of
${auto-detect-url}
– it watches your application run, and when it outputs the right message to stdout we grab it and start a browser. It is actually your application that does know this value. I am afraid I am not enough of an ASP.NET Core expert to tell you exactly where the framework is reading the URL from, but you could read the URL from whatever configuration file ASP.NET is getting it from.I want to know this value in my application, and my first approach was to set as an environment variable.