Building C# code in VSCode on Mac

2.4k views Asked by At

I've been building a command line tool using Xamarin. After being told about Visual Studio Code, I wanted to see if I could try using it as an editor and debugger.

I managed to get it to debug an existing .exe file built with Xamarin, by editing the launch.json file, and it knows which source files to jump into when stepping through the code.

However, I can't work out how to actually get it to compile a new executable? Whenever I make any changes to the source, it simply debugs the old executable that's in <my project>/<my project>/bin/Debug/<project>.exe, as was the default in Xamarin.

It seems to understand the source code itself since it has a load of warnings.

2

There are 2 answers

2
Andre Weinand On BEST ANSWER
0
Mark Burgress On

You use mcs, for example:

mcs -out:program.exe -recurse:'*.cs'