$ Sudo apt-get install mono-gmcs libmono-system-data2.0-cil libmono-system-messaging2.0-cil libmono-system-ldap2.0-cil libmono-system-messaging2.0-cil libmono-system-runtime2.0-cil libmono-system-web2.0-cil libmono-system-web-mvc1.0-cil libmono-wcf3.0-cil
Optional:
Libmono-oracle2.0-cil libmono-npgsql2.0-cil libmono-nunit2.4-cil libmono-sharpzip2.84-cil
Installation information:
0 upgraded, 82 newly installed, 0 to remove and 37 not upgraded.
Need to get 21.8 MB of archives.
After this operation, 81.7 MB of additional disk space will be used.
Do you want to continue [Y/n]?
......
View related information:
$ Mono-V
Mono JIT compiler version 2.4.2.3 (Debian 2.4.2.3 + dfsg-2)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: _ thread
GC: encoded ded Boehm (with typed GC)
SIGSEGV: altstack
Specifications: epoll
Architecture: x86
Disabled: none
$ Gmcs -- help
Mono C # compiler, Copyright 2001-2008 Novell, Inc.
Mcs [options] source-files
-- About About the Mono C # compiler
-Addmodule: M1 [, Mn] Adds the module to the generated assembly
-Checked [+ |-] Sets default aritmetic overflow context
-Codepage: ID Sets code page to the one in ID (number, utf8, reset)
-Clscheck [+ |-] Disables CLS Compliance verifications
-Define: S1 [; S2] Defines one or more conditional symbols (short:-d)
-Debug [+ |-],-g Generate debugging information
-Delaysign [+ |-] Only insert the public key into the assembly (no signing)
-Doc: FILE Process documentation comments to XML file
-Help Lists all compiler options (short :-?)
-Keycontainer: NAME The key pair container used to sign the output assembly
-Keyfile: FILE The key file used to strongname the ouput assembly
-Langversion: TEXT Specifies language version modes: ISO-1, ISO-2, or Default
-Lib: PATH1 [, PATHn] Specifies the location of referenced assemblies
-Main: CLASS Specifies the class with the Main method (short:-m)
-Noconfig Disables implicitly referenced assemblies
-Nostdlib [+ |-] Does not reference mscorlib. dll library
-Nowarn: W1 [, Wn] Suppress one or more compiler warnings
-Optimize [+ |-] Enables advanced compiler optimizations (short:-o)
-Out: FILE Specifies output assembly name
-Pkg: P1 [, Pn] References packages P1.. Pn
-Recurse: SPEC Recursively compiles files according to SPEC pattern
-Reference: A1 [, An] Imports metadata from the specified assembly (short:-r)
-Reference: ALIAS = A Imports metadata using specified extern alias (short:-r)
-Target: KIND Specifies the format of the output assembly (short:-t)
KIND can be one of: exe, winexe, library, module
-Unsafe [+ |-] Allows to compile code which uses unsafe keyword
-Warnaserror [+ |-] Treats all warnings as errors
-Warnaserror: W1 [, Wn] Treats one or more compiler warnings as errors
-Warn: 0-4 Sets warning level, the default is 4 (short-w :)
-Help2 Shows internal compiler options
Resources:
-Linkresource: FILE [, ID] Links FILE as a resource (short:-linkres)
-Resource: FILE [, ID] Embed FILE as a resource (short:-res)
-Win32res: FILE Specifies Win32 resource file (. res)
-Win32icon: FILE Use this icon for the output
@ File Read response file for more options
Options can be of the form-option or/option
$ Ls-1/usr/lib/mono/2.0
Accessibility. dll
CustomMarshalers. dll
Gacutil.exe
Gmcs.exe
Gmcs.exe. config
I18N. dll
I18N. West. dll
ICSharpCode. SharpZipLib. dll
Mono. CompilerServices. SymbolWriter. dll
Mono. Data. SqliteClient. dll
Mono. Data. Sqlite. dll
Mono. Data. Tds. dll
Mono. Http. dll
Mono. Messaging. dll
Mono. Posix. dll
Mono. Security. dll
Mono. WebBrowser. dll
Mono. Web. dll
Mscorlib. dll
Novell. Directory. Ldap. dll
OpenSystem. C. dll
System. ComponentModel. DataAnnotations. dll
System. Configuration. dll
System. Configuration. Install. dll
System. Core. dll
System. Data. DataSetExtensions. dll
System. Data. dll
System. Data. Linq. dll
System. Design. dll
System. DirectoryServices. dll
System. dll
System. Drawing. Design. dll
System. Drawing. dll
System. EnterpriseServices. dll
System. IdentityModel. dll
System. IdentityModel. Selectors. dll
System. Management. dll
System. Messaging. dll
System. Runtime. Remoting. dll
System. Runtime. Serialization. dll
System. Runtime. Serialization. Formatters. Soap. dll
System. Security. dll
System. ServiceModel. dll
System. ServiceModel. Web. dll
System. ServiceProcess. dll
System. Transactions. dll
System. Web. Export actions. dll
System. Web. dll
System. Web. DynamicData. dll
System. Web. Extensions. Design. dll
System. Web. Extensions. dll
System. Web. Mvc. dll
System. Web. Routing. dll
System. Web. Services. dll
System. Windows. Forms. dll
System. Xml. dll
System. Xml. Linq. dll
Write a C #3 program to test it:
$ Vim test. cs
Using System;
Using System. Linq;
Namespace Learn. CUI
{
Class Program
{
Static void Main ()
{
Var users = new [] {new {Name = "ZhangSan", Age = 30}, new {Name = "LiSi", Age = 25 }};
Var q = from u in users where u. Age> 26 select u. Name;
Foreach (var item in q)
{
Console. WriteLine (item );
}
Console. WriteLine ("Press any key to exit ...");
Console. ReadKey (true );
Environment. Exit (0 );
}
}
}
$ Gmcs test. cs
$ Ls
Test. cs test.exe
$./Test.exe
ZhangSan
Press any key to exit...