在Linux(Debian)下安装mono

王朝system·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Debian是诸多Linux发行版之一。MONO是.net在Linux下的移值版,通过Debian的apt-get可方便的安装MONO

1.首先在 /etc/apt/sources.list 內加上:

deb http://pkg-mono.alioth.debian.org/current ./

deb-src http://pkg-mono.alioth.debian.org/current ./

2.更新现有包:

apt-get update

3.安装

apt-get install mono

安装需要40M空间,如果要更新依赖包,将需要更多空间

第一个Linux下的.net程序:

debian:~# cat > hello.cs

using System;

class Hello {

static void Main() {

Console.WriteLine ("Hello, World!");

}

}

debian:~# mcs /target:exe hello.cs

Compilation succeeded

debian:~# ./hello.exe

Hello, World!

将该程序复制到windows下,可以直接执行。

第一个windows下的.net程序

c:\csc helloWin.cs

将生成helloWin.exe,该程序可以Windows下执行。

将该程序COPY到Linux下,因为linux下的可执行程序必须要用可执行的属性,通过:

chmod u=rwx helloWin.exe

赋于可执行属性。

debian:~# ./helloWin.exe

Hello, World!

可成功运行。

通过MONO,Windows下的.net程序可直接运行在Linux下,Linux下生成的.net程序也可直接运行在Windows下,真的很COOL。

由于我在VMWARE中装的Linux,所以不知道在VMWare中怎么访问HOST机中WindowsXP下的文件,有知道的朋友,请告之。Debian下好像有一个直接从网站下载文件的程序,有知道的朋友,也吱一声.

相关网站:

MONO在Debian下的发行版

http://pkg-mono.alioth.debian.org/

MONO的老巢,其中有各个平台的MONO发行版:

http://www.go-mono.org/

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航