【转】在CentOS 6.X上部署C# 开发环境

1.更新系统   

 yum update

 

2.安装必要的相关库   

 yum install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel  cairo-devel httpd httpd-devel

 

3.安装 libgdiplus

 cd /usr/local/src/

 wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2

 tar -jxvf libgdiplus-2.10.tar.bz2

 cd libgdiplus-2.10

 ./configure --prefix=/opt/mono

 make

 make install

 echo "/opt/mono/lib" > /etc/ld.so.conf.d/mono.conf

 ldconfig 

 

4.安装 mono  

 cd /usr/local/src/

 wget http://download.mono-project.com/sources/mono/mono-2.10.6.tar.bz2

 tar -jxvf mono-2.10.6.tar.bz2

 cd mono-2.10.6

 ./configure --prefix=/opt/mono

 make 

 make install

 echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile

 echo export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH>>~/.bash_profile

 echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile

 source ~/.bash_profile

 

 输入 mono -V 可查看安装好的版本

 

6、创建hello.cs文件

using System;
  
public class HelloWorld
{
    static public void Main ()
    {
        Console.WriteLine ("Hello Mono World");
    } 
}

 

7、编译运行

mcs hello.cs

mono hello.exe

 

原帖地址:https://blog.csdn.net/gaoxuefeng/article/details/7907652

     https://blog.csdn.net/yenange/article/details/53489361

 

 

posted @ 2018-07-07 21:27  鱼剑浆糊  阅读(329)  评论(0编辑  收藏  举报