-
Notifications
You must be signed in to change notification settings - Fork 676
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
Fix Visual Studio Code build task give 'The terminal shell path “dotnet” is a directory' #3372
base: main
Are you sure you want to change the base?
Conversation
This seems reasonable to me, but I am not sure if there is any downside of running |
I run |
@dbaeumer this PR is proposing to change the tasks.json tasks generated by the C# extension to use |
@gregg-miskelly besides spinning up the shell there is a different interpretation of the arguments. In process they go directly to the process and with shell they are subject to shell interpretation logic. What is the underlying reasons of having process fail in this setup. And in general you should use task providers now and not adding tasks to the tasks.json file. |
@dbaeumer The underlying problem with For using task providers instead -- you are suggesting this as a way of simplifying the tasks.json content as well as making it possible to change without requiring users to regenerate their tasks.json file? In our case, if I understand things correctly, I believe users would still need a tasks.json file since users need to specify the project file to build. But certainly we could use task providers to make this a bit simpler. |
@gregg-miskelly I assume this only happens under Windows :-) since there we have our own code to find the executable. The problem lies here: https://github.com/Microsoft/vscode/blob/master/src/vs/base/node/processes.ts#L467 This should not do an exist. It should do a stat and then check if it is a file. I opened microsoft/vscode#83509 and we should try to fix this for October. |
@dbaeumer |
@alexr00 do we execute the code under Linux as well ? |
It looks like the terminal might be. @dauphine-dev could you install the latest Insiders build of VS Code and see if you're still seeing the issue? |
@alexr00
|
@dauphine-dev what's the date or commit hash of the VS Code version you're using? I'm able to repro on stable, but not on today's Insiders build, using this task config (where my dotnet.exe is at {
"label": "build",
"command": "dotnet",
"options": {
"env": {
"PATH": "C:\\Program Files;C:\\Program Files\\dotnet"
}
},
"type": "process",
"args": [
"build",
"${workspaceFolder}/my.csproj", // replace this
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}, |
From the about menu:
I will try again the .deb installer from today. Edit: Version:
tasks.json
Issue:
|
I eventually managed to reproduce this, somehow, but it's quite frustrating. I got it to happen on my Insiders built, and it now happens consistently there. But then when opening the same workspace with the OSS build (where I can actually debug), even on the same commit that Insiders was built from, I don't run into the issue, and I can't seem to get it to repro again. Trace-level logs in vscode aren't very useful, and
|
Does |
I think that's it. I had created |
|
@alexr00 it's a bug in the terminal too though; if it's a dir it should still check the path not fail there. microsoft/vscode#83772 |
@Tyriar makes sense! Summary: The issue occurred when the |
I am not sure about that.
And my task.json:
Commands are |
This should now be fixed for non-windows systems as well in the next insider build: microsoft/vscode#158666. The issue only occured when the process PWD contained the folder with the same name as the |
it's still an issue. |
Fix Visual Studio Code build task give 'The terminal shell path “dotnet” is a directory'
See:
https://stackoverflow.com/questions/58072505/visual-studio-code-build-task-give-the-terminal-shell-path-dotnet-is-a-direct/5