microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.97k stars 29.53k forks source link

Path to tasks.json 'process' is incorrectly resolved in Windows Visual Studio Codespaces #101073

Closed gregg-miskelly closed 4 years ago

gregg-miskelly commented 4 years ago

This issue is from a bug opened by @kendrahavens (https://github.com/OmniSharp/omnisharp-vscode/issues/3878)

Steps to Reproduce:

  1. Create a VSCode Codespaces instance with default .NET Core console app template in Windows Codespaces (doesn't repro with Linux)
  2. Open with "Connect" option to open with VSCode in the web browser
  3. Accept pop-up to load debug assets
  4. Run the build task.

Result:

tasks.json tries to run dotnet.exe from C:\workspace\dotnet instead of from where it is installed, and so it fails.

Terminal output

> Executing task: C:\workspace\dotnet build C:\workspace/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary <

The terminal shell path "C:\workspace\dotnet" does not exist

Terminal will be reused by tasks, press any key to close it.

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "publish",
            "command": "dotnet",
            "type": "process",
            "args": [
                "publish",
                "${workspaceFolder}/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "watch",
            "command": "dotnet",
            "type": "process",
            "args": [
                "watch",
                "run",
                "${workspaceFolder}/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}
alexr00 commented 4 years ago

For this step:

Create a VSCode Codespaces instance with default .NET Core console app template in Windows Codespaces (doesn't repro with Linux)

How do I get the default .NET Core console app template?

kendrahavens commented 4 years ago

@alexr00 If dotnet is installed, you can run dotnet new console from the terminal. docs

alexr00 commented 4 years ago

Looks like findExecutable needs to be moved to the extension host. This wasn't needed before because it's only required for Windows, and we didn't have Windows remotes.

allan-mobley-jr commented 4 years ago

Visual Studio Codespaces Insiders

Encountering the same issue with dotnet new webapp.

I can get around this with using the absolute path in command:

"tasks": [
        {
            "label": "build",
            "command": "C:\\Program Files\\dotnet\\dotnet.exe",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/QBCart.Server.Client.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        },
        ...
]
alexr00 commented 4 years ago

I tested with an SSH Windows remote, and I see the executable path being correctly found now. Please let me know if you try it out in the next insiders build!

roblourens commented 4 years ago

I'm using a windows codespace, with the build from 7/23, and I think I still see this issue

image

alexr00 commented 4 years ago

Interesting. I tried it with a windows codespace and got:

C:\Program Files\dotnet\dotnet.exe build C:\workspace/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode/TestCodespacesWindowsAndVSCode.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary <

This is with the build from 8/3. Not sure what could be going on here. I'm going to close and see if someone else can verify.