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");
}
}
class HelloMono
{
public static void Main(string[ ] args)
{
System.Console.WriteLine("Hello Mono");
}
}
编译:
mcs hw.cs
运行:
mono hw.exe
更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-08/134581.htm