Skip to content

Project path makes compilation tools path not able to be read correctly #13049

@LearnWebGitHub

Description

@LearnWebGitHub

I found out how to reproduce this issue.
(compilation's gonna fail even if the MSVC tools path is correct)

error: 'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

If the path of my project (where ".vscode/tasks.json" is in) has any spaces, the MSVC tools path in tasks.json cannot be read correctly.

e.g.

MSVC tools path: "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/VsDevCmd.bat\""
and the project path has no space(C:\Users\Foo\Code\MSVC\C++\learn): cl.exe is launched correctly

MSVC tools path: "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/VsDevCmd.bat\""
and the project path has spaces(C:\Users\Foo\Code\MSVC\C++\learn - copy): get error 'C:/Program' is not recognized as an internal or external command

but in this case they'll both work, that's why I'm sure my path is correct:

MSVC tools path: "C:\"/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/VsDevCmd.bat\""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language Servicebughelp wantedCan be fixed in the public (open source) repo.tasks/build/debugAn issue relating to tasks.json (e.g. build issues)

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions