-
Notifications
You must be signed in to change notification settings - Fork 738
Open
Labels
DebuggerFeature - Run File#: and #! directives and file-based C# programs#: and #! directives and file-based C# programsuntriaged
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:
"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:
"configurations": [
{
"name": "myfile.cs",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build myfile",
"program": "${env:TEMP}\\myfile.dll",
"args": [all the args to pass here]
}]Metadata
Metadata
Assignees
Labels
DebuggerFeature - Run File#: and #! directives and file-based C# programs#: and #! directives and file-based C# programsuntriaged