I\'ve looked at the different resources for other editions of visual studio but it\'s not clear to me how to call Main with an arg here
using System;
namesp
I know this is an old post, but I think that it would be good to provide an answer for those looking to use the terminal.
When installing Visual Studio:Community Edition on MacOS you are given a suite of tools. Including csc and mono.
So to run a C# console program like the one below you will need to use both tools:
using System;
namespace helloWorld
{
class Program
{
static void Main(string[] args)
{
string name = args[0];
Console.WriteLine("Hello {0}", name);
}
}
}
Then compile the C# project by running csc:
$ csc Program.cs
If there are no errors csc will then create an executable file .exe, use mono to run the executable and pass the arguments:
$ mono Program.exe Bob
Hello Bob
With these two tools you can compile, and execute the C# program.