vscode-csharp
vscode-csharp copied to clipboard
Unable to configure commandline args with help
I was unable to figure out how to enable command line args using this page: https://code.visualstudio.com/docs/csharp/debugger-settings
I asked Bing Copilot and it gave me the answer I wanted with copy/paste syntax right away. It gave me a helpful explanation, plus the following JSON.
{
"version": "0.2.0",
"configurations": [
{
"type": "coreclr",
"request": "launch",
"name": "Debug MyApp",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/MyApp.dll",
"args": ["arg1", "arg2", "arg3"]
}
]
}
Prompt: "how do I specify command line arguments in vs code launch.json for C#?"
@richlander was the issue that you didn't have a launch.json starting point? Or that the docs don't really spell out an example?
FYI --
- The recommended way to do this is with launchSetting.json rather than launch.json, though we don't currently have a great gesture to set this up :(
- The copilot-generated example, is not great -- I hope your app isn't targeting .NET Core 3.1, and it doesn't have a build task
- If you do want to generate a launch.json and you have Dev Kit installed, the best way to do so is by running '.NET: Generate Assets for Build and Debug' from the command pallet. I think we should at least add a 'Setting up launch.json' section to the top of https://code.visualstudio.com/docs/csharp/debugger-settings with this information.