Description
dotnet-script is really, really cool! The only (minor) problem for me is the fixed file path in the .vscode/launch.json
file.
Is there any chance that the vscode dotnet script
launch configuration could be improved to not use a user specific absolute path?
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Script Debug",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": [
"exec",
"C:/Users/my_username/.dotnet/tools/.store/dotnet-script/1.4.0/dotnet-script/1.4.0/tools/net6.0/any/dotnet-script.dll",
"${file}"
],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
}
]
}
I often share .vscode/launch.json
files (with multiple configurations) for tutorials. It would be really helpful if the person downloading the tutorial could just run it (like a standard c# project) without having to adjust the launch file. The user can't run dotnet script init
to set the path correctly because there is an existing launch file.
I spent a while trying to get around this by using vscode variable references, but I think the best I would be able to do is create a custom vscode extension that would just return the correct dotnet script
path.
Maybe the dotnet
command could be improved in the future to know the path to dotnet-script.dll
?
Any other ideas?
Thanks! c# script files are pretty awesome!