c# - Start to compile and run mono c# code

Mono is some runtime that you can use on Linux  or other Unix box to compile/run C# code . Though I am not sure if I can directly run the code that is compiled by csc and run that that on mono, this is still up in the air for now.


to compile a source code to mono binaries, you can directly do this

msc Hellomono.cs

and to run the compiled output, you can directly do like this: 

mono Hellomono.exe


Below is one sample code that I used to test how to use the mono tools

using System;
public class Helloworld
{
  public static void Main(string[] args)
  {
      Console.Out.WriteLine("Hello Mono");
  }

}

the output is almost trivial, but it shows that the possibility to write the same code for both the Microsoft C# and the Mono C#.





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章