Working with the new VSCode editor on a node.js project. I am attempting to configure my "Launch" profile for debugging by editing the launch.json file. I need to setup a connectionstring as an environment variable. According to the comments in the launch.json file:
// Environment variables passed to the program.
"env": { }
I have tried adding my environment variable like so:
"env":
{
"CONNECTION_STRING": "Data Source=server;Initial Catalog=catalog;User ID=uid;Password=pwd;MultipleActiveResultSets=true"
}
This causes an error when I try to launch my app; "OpenDebug process has terminated unexpectedly". I have not yet found any log files, etc. that might explain what the issue is.
I know this app works correctly when I setup the environment variable and launch my app from the standard command prompt. The app also runs as expected if I comment out my variable in the launch.json file; I just can't connect to the database.
I am assuming that I am using the wrong format in the launch.json file, but I have not yet found any way to make this work.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…