yum -y install yum-utils安装指定密钥用于验证mono的下载
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"设置下载Mono的yum源
yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/安装Mono
yum -y install mono-complete查看版本
[root@localhost ~]# mono -V Mono JIT compiler version 6.8.0.105 (tarball Tue Feb 4 19:25:27 UTC 2020) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: yes(610) Suspend: hybrid GC: sgen (concurrent by default)创建并运行Mono程序 创建Mono程序
[root@localhost ~]# mkdir /home/monotest [root@localhost ~]# vim /home/monotest/HelloWorld.cs # 添加 using System; public class HelloWorld { public static void Main() { Console.WriteLine("Hello Mono World"); } }运行程序
[root@localhost ~]# mcs /home/monotest/HelloWorld.cs [root@localhost ~]# mono /home/monotest/HelloWorld.exe Hello Mono World搭建成功!!!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)