Debugging a single file dotnet app with command line arguments is very unclear/obtuse
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 737
- Avg merge
- 18h 40m
- Merged PRs (30d)
- 31
Description
## Is your feature request related to a problem? Please describe.
The happy path for single file debugging is just clicking the button: https://code.visualstudio.com/docs/csharp/debugging#_debug-with-editor-debugrun-buttons
This apparently all falls apart when you want to pass command line arguments to your own program.
## Describe the solution you would like
Better documentation/out of the box support for passing command line args. I think single file apps are great for dotnet, and better supporting them in VSCode will lead to better adoptoin as well.
## Describe alternatives you've considered
Blindly stumbling around the docs trying to get this to work - sort of annoying.
## Additional context
I tried a lot of things, eventually ended up with with a custom prelaunch task to build the app:
```json
"tasks": [
{
"label": "build myfile",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}\\myfile.cs",
"--output",
"${env:TEMP}\\myfile"
],
"group": "build",
"problemMatcher": "$msCompile",
"presentation": {
"reveal": "silent",
"panel": "dedicated",
"close": true
}
}
]
```
launch.json:
```json
"configurations": [
{
"name": "myfile.cs",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build myfile",
"program": "${env:TEMP}\\myfile.dll",
"args": [all the args to pass here]
}]
```
Contributor guide
Assessment
This issue has not been assessed yet.