Skip to content
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

The preLaunchTask 'build' terminated with exit code -2. #79346

Closed
WellspringCS opened this issue Aug 17, 2019 · 7 comments · Fixed by #158666
Closed

The preLaunchTask 'build' terminated with exit code -2. #79346

WellspringCS opened this issue Aug 17, 2019 · 7 comments · Fixed by #158666
Assignees
Labels
info-needed Issue requires more information from poster tasks Task system issues

Comments

@WellspringCS
Copy link

In VSCode (not Insiders) I am seeing this error in a dialog box when hitting F5 to compile in Ubuntu:

The preLaunchTask 'build' terminated with exit code -2.

In the terminal window itself, this error is reported:

The terminal shell path "dotnet" is a directory

Version: 1.37.1
Commit: f06011a
Date: 2019-08-15T16:17:25.463Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.15.0-58-generic

This error is new, happens on all projects on this machine, and the errors began after installing updates.

BUT PLEASE NOTE: I have been aware that my dotnet folder is itself named dotnet -- not the (standard, I believe?) name .dotnet with a leading period. This is unorthodox, and due to the error message I was seeing, I decided now was a good time to align my machine with the norm. I renamed my folder to .dotnet and adjusted as necessary stuff in my .bashrc file.

Rebooted, and error is gone.

That said, I do think this is a bug in the latest version of VSCode. In older versions I did not have this problem.

@isidorn
Copy link
Contributor

isidorn commented Aug 19, 2019

Sounds like it is caused by the C# extension, though assigning to @alexr00 so she can decide.

@alexr00
Copy link
Member

alexr00 commented Aug 20, 2019

@WellspringCS Can you paste in your build task?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Aug 20, 2019
@WellspringCS
Copy link
Author

WellspringCS commented Aug 21, 2019

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}"
            ],
            "problemMatcher": "$tsc"
        },
     ...

Does that cover it for you, @alexr00 ? As I said, the bug is now history for me, as I renamed my dotnet folder, so no urgency on my part on this anymore.

I assume I could reproduce the error if I renamed my dotnet folder back to:
/home/[user]/dotnet
from
/home/[user]/.dotnet

@alexr00
Copy link
Member

alexr00 commented Aug 22, 2019

Since tasks run with bash -c your .bashrc won't be sourced. I'm guessing that somewhere dotnet was being added to your environment, but .dotnet was not. Since we don't have repro anymore. I'm going to close this bug.

@alexr00 alexr00 closed this as completed Aug 22, 2019
@alexr00 alexr00 added the tasks Task system issues label Aug 22, 2019
@WellspringCS
Copy link
Author

@alexr00 that sounds right. You''ll note in my original post that I made adjustments accordingly in my .bashrc file when switching to the standard dotnet folder.

I wonder what's changed, since my non-standard dotnet folder setup did work in the past, and I also wonder how any non-standard paths would then work in the current environment, if the user's .bashrc file is not sourced.

@nzain
Copy link

nzain commented Sep 21, 2019

@alexr00 Just stumbled into this issue on Ubuntu 18.4.3 and VS Code 1.38.1 because the recommended installation path (from dotnet core download page) is $HOME/dotnet which works fine from the terminal, but gives the above error in vs code.

Renaming my folder to dotnet3.0 resolved this issue. Since the default recommendation leads directly into this, please consider to fix it.

@nzain
Copy link

nzain commented Sep 21, 2019

just to add, I made dotnet visible via

ln -s ~/dotnet/dotnet ~/.local/bin/dotnet

using the fact that ~/.profile will add my local bin folder to the path on login by default.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 6, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster tasks Task system issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants