1

The C/C++ build tools have been installed. The program can be built, a tasks.jason file generated, But when the Rust program is run by way of Run Task, VS code says "msbuild : The term 'msbuild' is not recognized as the name of a cmdlet, function, script file, or operable program."

The whole message is below.

"msbuild : The term 'msbuild' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + msbuild /property:GenerateFullPaths=true /t:build "

Varuna
  • 1,343
  • 3
  • 15
  • 30
  • If msbuild is indeed installed, is it in your PATH? – mcarton Aug 07 '19 at 08:32
  • @mcarton How to add msbuild to the PATH?, and doesn't "GenerateFullPaths=true /t:build" get msbuild placed in PATH – Varuna Aug 07 '19 at 08:35
  • 1
    can you check the tasks.json file and see which program is listed in `command`? if you want to create a rust task, shouldn't you run `rustc` or `cargo`? Can you perhaps paste the tasks.json file here? – default Aug 07 '19 at 16:19
  • @Default The extension used is Rust(rls) at https://marketplace.visualstudio.com/items?itemName=rust-lang.rust – Varuna Aug 08 '19 at 01:01
  • @Default At https://marketplace.visualstudio.com/items?itemName=rust-lang.rust, under quick start, how to install rustup, how to install the extension Rust(rls), and how to, create project, and add the project folder into VS Code is explained. Then, under Tasks, how to build project and run a project is explained. Why doesn't the VS Code work according to this description – Varuna Aug 08 '19 at 01:17
  • @Default Here is part of tasks.jason ""label": "build", "type": "shell", "command": "msbuild" – Varuna Aug 08 '19 at 01:21
  • maybe [this thread](https://stackoverflow.com/questions/46885292/how-to-launch-a-rust-application-from-visual-studio-code) can help? – default Aug 08 '19 at 09:15

0 Answers0