Ubuntu Mono 运行 Helloworld

Ubuntu Mono 运行 Helloworld

ref:

http://www.mono-project.com/docs/getting-started/install/linux/#usage

http://www.mono-project.com/docs/getting-started/

Install mono

运行下面代码授权注册repo源并更新软件列表:


sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list 

sudo apt-get update 

Install mono:


sudo apt-get install mono-complete

helloworld

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

编译:

mcs hw.cs

运行:

mono hw.exe

posted @ 2016-08-18 17:52  _DN  阅读(410)  评论(0编辑  收藏  举报