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
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#.

本文介绍如何在Linux或Unix环境下使用Mono编译及运行C#代码。通过简单的示例代码展示了从编译到执行的全过程,验证了C#程序在不同平台上的兼容性。
354

被折叠的 条评论
为什么被折叠?



