-
Notifications
You must be signed in to change notification settings - Fork 174
vscode launch file absolute path workaround? #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We generate a better
Is it an option for you to use it as global tool? |
Actually.. looks like your path is really a global tool paths, so maybe the scaffolder has some detection bug. However, you can try the |
Thanks!!! ❤️ That is so much better than what I had been doing 😝 https://github.com/StateSmith/example-drawio-1/blob/bd8fb84bfc81e1339712c6129b87fc5361198a15/.vscode/launch.json#L21 |
The behavior seems OS specific (Linux generates the good launch.json). Using dotnet-script version 1.5.0 for both windows and WSL2 creates different windows (not ideal because of absolute path): {
"version": "0.2.0",
"configurations": [
{
"name": ".NET Script Debug",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": [
"exec",
"C:/Users/user/.dotnet/tools/.store/dotnet-script/1.5.0/dotnet-script/1.5.0/tools/net8.0/any/dotnet-script.dll",
"${file}"
],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
}
]
} WSL2 (good!): {
"version": "0.2.0",
"configurations": [
{
"name": ".NET Script Debug",
"type": "coreclr",
"request": "launch",
"program": "${env:HOME}/.dotnet/tools/dotnet-script",
"args": ["${file}"],
"windows": {
"program": "${env:USERPROFILE}/.dotnet/tools/dotnet-script.exe",
},
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
}
]
} Is it worth re-opening the issue to address at some point in the future? |
Thanks for reporting this - this should fix it #753 |
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?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 rundotnet 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 todotnet-script.dll
?Any other ideas?
Thanks! c# script files are pretty awesome!
The text was updated successfully, but these errors were encountered: