0

mcs command not found

Hello thank you for your time. I am a little inexperienced. I'm using visual studio code developer pack with all the c# extensions. I've tried using git bash and powershell and the mcs command is not found and I don't know where or how to download it. I'm not even sure what package managers I have. I'm working on a C# Objects project on TeamTreehouse.com and I don't want to keep using workspaces. I'm trying to compile and run the TreehouseDefense project.

Here is the command I typed into the terminal

mcs -out:TreehouseDefense.com *.cs && mono TreehouseDefense.com

Here is the error message I get

mcs : The term 'mcs' is not recognized as the name of bja cmdlet, function, script file, or operable program. ioCheck 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
+ mcs --version
+ ~~~
    + CategoryInfo          : ObjectNotFound: (mcs:Str 
   ing) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

On my macbook air that command compiles and runs the project. Unfortunately the mac is out of commission right now. Also I tried downloading mcs from github but I couldn't find an executable file or anything. I'm not very good with github yet. I also searched for bash commands to download mcs but I couldn't find anything except for something to do with RedHat and I think it was the wrong mcs. I know I'm looking for a c# compiler but that's all I know. Also I installed node.js and tried to use npm to install mcs or mono but those packages apparently did not exist to npm

  • mcs.exe is the c# compiler. On a linux machine use "which" that give location of executable > which mcs. Apparently it is not on your PATH and is not found. – jdweng Jan 05 '23 at 11:13
  • Thank you! I added Mono to my path and the compiler worked in git bash. – saiyan_sage_8 Jan 05 '23 at 12:22

0 Answers0