Ubuntu Mono 运行 Helloworld

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

猜你喜欢

转载自www.linuxidc.com/Linux/2016-08/134581.htm