I’m trying to setup launch.json
and launchSettings.json
for a C# project in VS Code. The behavior that I am seeing when I debug the project is not what the following documentation indicates.
https://code.visualstudio.com/docs/csharp/debugger-settings#_args
https://code.visualstudio.com/docs/csharp/debugger-settings#_environment-variables
According to this I should be able to use "env": { "name": "value" }
to set runtime environment variables, and "args": [ "arg1", "arg2" ]
to supply command line arguments in launch.json
for the debug session. Neither of these result in environment variables nor args values being set.
I have successfully set environment variables using launchSettings.json
profile, with an "environmentVariables" : { "name": "value" }
property of the profile and associating the profile via the "launchSettingsProfile": "<profile name>"
property in launch.json
. The "commandLineArgs": [ "arg1", "arg2" ]
property of the profile still does not set the args parameter though.
On top of that the IntelliSense doesn’t think any of the documented args
, env
, nor lauchSettingsProfile
are valid, showing a yellow squiggly under the attribute names.
What is the JSON schema definition for the dotnet
launch config that IntelliSense is using? What can I do to get the debug session to pick up the command line args values?