Mono: Developing and Deploying Microsoft .Net Applications for Linux

Karl Bunnell

Software Engineer Consultant

Novell, Inc.

Mono Overview

What is Mono?

An Open Source .NET Framework Implementation.

Effort lead by Ximian, launched in July 2001

~100 contributors, ~30 very active

Goals

Bring the .NET Framework to Unix

Virtual Execution System

Class Libraries compatible with .NET Framework

CLI compliant execution system.

Just-in-time compiler on x86 systems.

Multi-platform (Linux, Solaris, BSD, Windows)

Mono Platforms

Mono currently supports:

Unix:

X86: Linux, xxxBSD

PPC: Linux

StrongARM: Linux

Sparc: Linux and Solaris

S390: Linux.

Windows NT:

NT and XP (x86)

Windows 9x core.

JIT: x86 at this point only.

What exactly does Mono include?

Runtime (Embedded)

Classes

Gtk#

ASP.NET

ADO.NET

C# Compiler

VB Compiler

The Mono Runtime

Runtime: compatible with the .Net runtime

Mono

Our Just-in-Time and Ahead-of-Time code generator for maximum performance.

Mint

The Mono interpreter. This is an easy-to-port runtime engine.

Just-in-Time Engine

Written their own JIT compiler

Ahead-of-time compilation

Have a good platform for doing code optimizations

Reduce the effort required to port the Mono code generator to new architectures

The Mono Runtime

Garbage Collection

Using the Boehm conservative GC

IO and threading

IO model and a threading model that is very similar to the Win32 API.

Class Libraries

Should be compatible with Microsoft's .NET implementation

Classes in Mono are organized by the assembly that they belong to

corlib: The core library.

System: Extra modules

System.Xml.

System.Data: Database access functionality

System.Drawing.

System.Web: ASP.NET classes

System.Web.Services.

Microsoft.VisualBasic: Support runtime for Visual Basic Windows.Forms:

System.Runtime.Serialization.Formatters.Soap.

System.Security: Xml Signature Security classes

Gtk#

Gtk# is a .Net language binding for the gtk+ toolkit and assorted GNOME libraries.

Brings the power and ease of .Net development

Provides a C source parser and C# code generator

Produce .Net assemblies that bind to GObject based libraries.

Currently wrapped libraries

libglade

gda

libgnomeui

pango

libgnomecanvas

atk

gconf

gdk

gnomedb

gtk

ASP.NET

ASP.NET supports

Web Forms (Web Applications infrastructure)

Web Services (the SOAP-based rpc system)

ASP.NET works with

XSP

A light-weight C# web server that runs ASP.NET applications

Mod_mono

An apache module that can host the Mono runtime and the ASP.NET runtime

Limited to C# for the server-side-scripts

ASP.NET Execution Model

VB

C#

C++

Compiler

Compiler

Compiler

Assembly

IL Code

Assembly

IL Code

Assembly

IL Code

Common Language Runtime

JIT Compiler

Native Code

Operating System Services

Unmanaged Component

Source Code

Managed Code

ADO.NET

ADO.NET Data Providers

Mono has many ADO.NET Data Providers to get you connected:

IBM DB2 Universal Database

MySQL

ODBC

Oracle

OLE DB

PostgreSQL

Microsoft SQL Server

SQL Lite

Sybase

TDS Generic

C# compiler

C# Compiler (mcs)

Written in C#

Considered feature complete

MCS is able to compile itself

Mono Debugger

Written in C#

Implements its own debugging framework.

Debugging classes, multiple front-ends.

Multi-language debugger

Can debug .NET applications.

Can debug native Unix applications.

New GUI front-end for the debugger

VB Compiler

Mono's Basic.NET (mbas)

CIL compiler of the Visual Basic language

Extended version of VisualBasic.NET

Based on the MCS compiler

Still under development

Native Platform (x86, SPARC, PPC, StrongARM, S390)

JIT, Loader, Verifier

Threads, I/O

GC

Mono Runtime

.NET Classes:

Core + XML

ADO.NET

ASP.NET

Mono Classes:

Gtk#: Gtk, Gnome, A11n, Media

PEToolkit

Mono Development Tools:

C# Compiler, Debugger, Profiling.

Summary

Mono Project Resources

Mono:

http://www.go-mono.com

http://www.go-mono.com/download.html

GNOME project:

http://www.gnome.org

ASP.NET Primer

What is ASP?

ASP is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.

ASP is a Microsoft Technology

ASP stands for Active Server Pages

Also known as Classic ASP

ASP is a program that runs inside IIS

IIS stands for Internet Information Services

PWS is a smaller - but fully functional - version of IIS

PWS can be found on your Windows 95/98 CD

What is an ASP File?

An ASP file is just the same as an HTML file

An ASP file can contain text, HTML, XML, and scripts

Scripts in an ASP file are executed on the server

An ASP file has a .asp extension

How Does it Work?

When a browser requests an HTML file, the server returns the file

When a browser requests an ASP file, IIS passes the request to ASP

ASP engine reads the file, line by line, and executes the scripts in the file

Finally, the ASP file is returned to the browser as plain HTML

What is ASP+?

ASP+ is the same as ASP .NET.

ASP+ is just an early name used by Microsoft when they developed ASP .NET.

What is ASP .NET?

ASP 3.0 is the latest version of ASP, but there will never be an ASP 4.0 version

ASP .NET is the next generation ASP, but it's not an upgraded version of ASP.

ASP .NET is an entirely new paradigm for server-side ASP scripting.

ASP .NET is a part of the new .NET (dotnet) Framework. Microsoft spent three years rewriting ASP .NET from the ground up, and ASP .NET is not fully backward compatible with ASP 3.0.

.NET Framework

Is a common environment for building, deploying, and running Web applications and Web Services.

Contains a common language runtime and common class libraries - like ADO .NET, ASP .NET and Windows Forms.

Currently it supports C++, C#, Visual Basic, and JScript (The Microsoft version of JavaScript).

Microsoft's Visual Studio.NET is a common development environment for the new .NET Framework.

ASP .Net Pages

A simple ASP .NET page looks just like an ordinary HTML page

<html>

<body bgcolor=“red">

<center>

<h2>Novell Rocks!</h2>

</center>

</body>

</html>

Dynamic Page in ASP .NET

The code inside the <% --%> tags is executed on the server.

<html>

<body bgcolor="red">

<center>

<h2>Novell Rocks!</h2>

<p><%=DateTime.Now%></p>

</center>

</body>

</html>

ASP .NET – Server Controls

With Classic ASP it is impossible to separate executable code from the HTML itself.

ASP .NET has solves this problem with server control tags that are understood by the server.

There are three kinds of server controls

HTML Server Controls - Traditional HTML tags

Web Server Controls - New ASP .NET tags

Validation Server Controls - For input validation

ASP .NET – HTML Server Controls

Are HTML tags understood by the server.

Add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control. The id attribute is added to identify the server control. The id reference can be used to manipulate the server control at run time.

All HTML server controls must be within a <form> tag with the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts.

ASP .NET – HTML Server Controls Example

<script runat="server">

void Page_Load (Object obj, EventArgs e) {

link1.HRef=“http://www.novell.com”;

}

</script>

<html>

<body>

<form runat="server">

<a id="link1" runat="server">Visit Novell!</a>

</form>

</body>

</html>

HTML Server Control Description

HtmlAnchor	Controls an <a> HTML element

HtmlButton	Controls a <button> HTML element

HtmlForm	Controls a <form> HTML element

HtmlGeneric	Controls other HTML element not specified by a specific HTML server	control, like <body>, <div>, <span>, etc.

HtmlImage	Controls an <image> HTML element

HtmlInputButton	Controls <input type="button">, <input type="submit">, and	<input type="reset"> HTML elements

HtmlInputCheckBox	Controls an <input type="checkbox"> HTML element

HtmlInputFile	Controls an <input type="file"> HTML element

HtmlInputHidden	Controls an <input type="hidden"> HTML element

HtmlInputImage	Controls an <input type="image"> HTML element

HtmlInputRadioButton	Controls an <input type="radio"> HTML element

HtmlInputText	Controls <input type="text"> and <input type="password"> HTML elements

HtmlSelect	Controls a <select> HTML element

HtmlTable	Controls a <table> HTML element

HtmlTableCell	Controls <td>and <th> HTML elements

HtmlTableRow	Controls a <tr> HTML element

HtmlTextArea	Controls a <textarea> HTML element

ASP .NET – Web Server Controls

Web server controls are special ASP .NET tags understood by the server.

Like HTML server controls, Web server controls require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

The syntax for creating a Web server control

<asp:control_name id="some_id" runat="server" />

ASP .NET – Web Server Controls Example

<script runat="server">

void submit(object o, EventArgs e) {

button1.Text="You clicked me!" ;

}

</script>

<html>

<body>

<form runat="server">

<asp:Button id="button1" Text="Click me!"

runat="server" OnClick="submit"/>

</form>

</body>

</html>

ASP .NET – Validation Server Controls

Are used to validate user-input. Displays an error message if not valid.

Each validation control performs a specific type of validation (like validating against a specific value or a range of values).

By default, page validation is performed when a Button, ImageButton, or LinkButton control is clicked. You can prevent validation when a button control is clicked by setting the CausesValidation property to false.

The syntax for creating a Validation server control is

<asp:control_name id="some_id" runat="server" />

ASP .NET – Validation Server Controls Example

<html>

<body>

<form runat="server">

Enter a number from 1 to 100:

<asp:TextBox id="tbox1" runat="server" /> <br /><br />

<asp:Button Text="Submit" runat="server" /> <br /> <asp:RangeValidator ControlToValidate="tbox1" MinimumValue="1" MaximumValue="100" Type="Integer" EnableClientScript="false" Text="The value must be from 1 to 100!" runat="server" />

</form>

</body>

</html>

Validation Server Control Description

CompareValidator	Compares the value of one input control to the	value of another input control or to a fixed value

CustomValidator	Allows you to write a method to handle the	validation of the value entered

RangeValidator	Checks that the user enters a value that falls	between two values

RegularExpressionValidator	Ensures that the value of an input control	matches a specified pattern

RequiredFieldValidator	Makes an input control a required field

ValidationSummary	Displays a report of all validation errors occurred	in a Web page

ASP .NET Web Forms

All server controls must appear within a <form> tag, and the <form> tag must contain the runat="server" attribute.

<form runat="server">

...HTML + server controls

</form>

If you specify an action attribute, it is ignored. If you omit the method attribute, it will be set to method="post". If you do not specify the name and id attributes, they are automatically assigned by ASP.NET.

<form name="_ctl0" method="post" action="page.aspx" id="_ctl0">

...some code

</form>

Submitting a Form

A form is most often submitted by clicking on a button.

<asp:Button id="id" text="label" OnClick="sub" runat="server" />

The id attribute defines a unique name for the button and the text attribute assigns a label to the button. The onClick event handler specifies a named subroutine to execute.

Maintaining the ViewState

When a form is submitted in ASP .NET, the form reappears in the browser window together with all form values. This is because ASP .NET maintains your ViewState. The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a <form runat="server"> control.

<form name="_ctl0" method="post" action="page.aspx" id="_ctl0">

<input type="hidden" name="__VIEWSTATE" value="dDwtNTI0ODU5MDE1Ozs+ZBCF2ryjMpeVgUrY2eTj79HNl4Q=" />

.....some code

</form>

If you do NOT want to maintain the ViewState, include the directive <%@ Page EnableViewState="false" %> at the top of an .aspx page or add the attribute EnableViewState="false" to any control.

Web Server Controls

AdRotator	Displays a sequence of images

Button	Displays a push button

Calendar	Displays a calendar

CheckBox	Displays a check box

CheckBoxList	Creates a multi-selection check box group

DataGrid	Displays fields of a data source in a grid

DataList	Displays items from a data source by using templates

DropDownList	Creates a drop-down list

HyperLink	Creates a hyperlink

Image	Displays an image

ImageButton	Displays a click-able image

Label	Displays static content which is programmable

LinkButton	Creates a hyperlink button

ListBox	Creates a single- or multi-selection drop-down list

Literal	Displays static content which is programmable

Panel	Provides a container for other controls

PlaceHolder	Reserves space for controls added by code

RadioButton	Creates a radio button

RadioButtonList	Creates a group of radio buttons

Repeater	Displays a repeated list of items bound to the control

Table	Creates a table

TableCell	Creates a table cell

TableRow	Creates a table row

TextBox	Creates a text box

Xml	Displays an XML file or the results of an XSL transform

The TextBox Control Examples

<html>

<body>

<form runat="server">

A basic TextBox:

<asp:TextBox id="tb1" runat="server" />

<br /><br />

A password TextBox:

<asp:TextBox id="tb2" TextMode="password"

runat="server" />

<br /><br />

A TextBox with text:

<asp:TextBox id="tb4" Text="Hello World!"

runat="server" />

<br /><br />

A multiline TextBox:

<asp:TextBox id="tb3" TextMode="multiline"

runat="server" />

<br /><br />

A TextBox with height:

<asp:TextBox id="tb6" rows="5"

TextMode="multiline" runat="server" />

<br /><br />

A TextBox with width:

<asp:TextBox id="tb5" columns="30"

runat="server" />

</form>

</body>

</html>

TextBox Script Example

<script runat="server">

Void change(Object obj, EventArgs e) {

lb1.Text="Your name is " + txt1.Text;

}

void submit(Object obj, EventArgs e) {

lbl1.Text="Your name is " + txt1.Text;

}

</script>

<html>

<body>

<form runat="server">

Enter your name:

<asp:TextBox id="txt1" OnTextChanged="change" runat="server" />

<asp:Button OnClick="submit" Text="Submit" runat="server" />

<p><asp:Label id="lbl1" runat="server" /></p>

</form>

</body>

</html>

What is ADO .NET

ADO .NET is a part of the .NET Framework

ADO .NET consists of a set of classes used to handle data access

ADO .NET is entirely based on XML

ADO .NET has, unlike ADO, no Recordset object

ADO.NET Data Providers

Mono has many ADO.NET Data Providers to get you connected:

IBM DB2 Universal Database

MySQL

ODBC

Oracle

OLE DB

PostgreSQL

Microsoft SQL Server

SQL Lite

Sybase

Older Microsoft SQL Server and Sybase databases

MySQL Data Provider

ByteFX.Data.MySQLClient

Written in 100% C#

Does not require a client library

Works on Mono and Microsoft .NET

Requires at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono

Works in the SQL# command-line and GTK# GUI version

Mono.Data.MySql (deprecated)

Deprecated in favor of ByteFX.Data.MySQLClient

Written in C# and uses the MySQL C Client Library

Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql

<%@ import namespace="System.Data" %>

<%@ import namespace="System.Reflection" %>

<script runat=server>

void Page_Load(Object obj, EventArgs e) {

string providerAssemblyName = "ByteFX.Data";

string connectionTypeName = "ByteFX.Data.MySqlClient.MySqlConnection";

string cncString = "Server=localhost;User ID=monotest;Password=monotest;Database=monotest";

Assembly dbAssembly = Assembly.Load (providerAssemblyName);

IDbConnection cnc=(IDbConnection)Activator.CreateInstance(dbAssembly.GetType(connectionTypeName, true));

cnc.ConnectionString = cncString;

cnc.Open ();

IDbCommand selectCommand = cnc.CreateCommand();

selectCommand.CommandText = "SELECT * FROM test";

IDataReader reader = selectCommand.ExecuteReader ();

while (reader.Read ()) {

TableRow row = new TableRow ();

for (int i = 0; i < reader.FieldCount; i++) {

TableCell cell = new TableCell ();

cell.Controls.Add (new LiteralControl (reader.GetValue (i).ToString ()));

row.Cells.Add (cell);

}

myTable.Rows.Add (row);

}

}

</script>

<html>

<body>

<h2>ADO .NET sample database application</h2>

<asp:Table id="myTable" GridLines="both" CellPadding="5" runat="server"/>

</body>

</html>

Mono – ASP.NET Exercises

Install the Mono environment

Execute the Red Carpet installer

From the top menu bar select System and then Software Update

Select the Available Software tab

Select Mono for the Channel

Select ALL the Mono components by clicking in the action field of each component

Click the Run Now button on the tool bar

Click the Continue button

When the installation is complete click the OK button

Close the Red Carpet Installer

Test the Installation

From a Terminal window execute the following:

export MONO_PATH=/opt/gnome2/lib

Execute the Mono documentation just to make sure things are working

monodoc

NOTE: The above steps have already been performed and thus 'MONO' is already installed on your system.

Start the Web Server

ASP.NET execution environment (consists of stand-alone web server and ASP.NET execution environment).

Execute the stand-alone web server XSP

cd to /usr/bin

mono xsp.exe --root /home/student/DHO101/xsp/test --port 8090

OR

Click on the “Run XSP Server” icon within the “DHO101” folder on your desktop.

Become Familiar with ASP.NET

Point web browser to http://localhost:8090

(Note: A page of links to ASP.NET pages will appear)

Click on some of the links that have the .aspx extension.

Modify custom httphandler

Open the file:

/home/student/DHO101/xsp/test/webhandler.ashx with your favourite editor. Change the text “Hi There!” within the “resp.Write” method to “Hello World”. Save the file then click on the link “webhandler.ashx” from your web browser.

Create a simple ASP.NET application

Open an editor and insert the following text:

<%@ language="C#" %>

<html>

<head>

<title>Welcome to Mono ASP.NET</title>

</head>

<body>

<h1>Hello and welcome!</h1>

<p>The date/time is: <%= DateTime.Now %></p>

</html>

Save the file as “hello.aspx” in:

/home/student/DHO101/xsp/test

Test your ASP.NET application

Refresh your browser and click on the “hello.aspx” link?

Q: Are you able to add additional c# functions to the “hello.aspx” code? (hint: See the “Class Library” section within monodoc.)

Q: How is this code different from the webhandler.ashx?

Install and configure MySQL

Using Red Carpet Install MySQL components:

mysql

mysql-client

Using 'Yast' select System, Runlevel Editor, and then Runlevel Properties. Select mysql from the list and check run levels 3 and 5 and then click the Start button.

Create a MySQL Database (monotest)

Using the mysql client to create a monotest database with two tables: test, and customers. Also create a monotest user and grant him all rights.

From a Linux Terminal Window enter the following:

mysql –u root

create database monotest;

use monotest;

create table test (person varchar(80), email varchar(80));

insert into test(person, email) values(‘john doe’, ‘jdoe@novell.com’);

create table customers( id int, name varchar(80), address varchar(120));

use mysql;

grant all on *.* to monotest@’localhost’ identified by ‘monotest’;

Configure the ByteFX driver

Modify the /home/student/DHO101/xsp/test/web.config and change the following:

DBProviderAssembly

Mono.Data.ProgresClient to ByteFX.Data

DBConnectionType

Mono.Data.PostgreSqlClient.PgSqlConnection to ByteFX.Data.MySqlClient.MySqlConnection

DBConnectionString

Host Addr to Server and set it equal to localhost

user to User ID

password to Password

dbname to Database.

Test ADO .NET

From you browser execute the dbpage1.aspx.

Use mysql client to add few more 'people' entries to the database:

INSERT INTO test VALUES(‘<Person Name>’, ‘<Email Address>’);

Use dbpage1.aspx to view and search for entries in the database.

Execute the dbpage2.aspx. Add and modify customers. Use mysql client to validate that the customers are being added to the customers table.

SELECT * FROM Customers;

Creating a Web Service with ASP.NET

Open and review the file:

/home/student/DHO101/xsp/test/TestService.asmx

Q: What transforms the c# class into a web service?

Click on the “TestService.asmx” link from your browser.

Invoke the “Echo” and “Add” methods.

(Hint: Click the Test Form link to test the method)

Creating a Web Service with ASP.NET

Modify the TestService.asmx and add a Subract, Multiply, and Divide method.

(Hint: you can simply copy the Add() method and make the necessary changes)

Q. Do the new methods show up when you invoke the class again?

Click on the “C# proxy” link. What is this?

(Hint: The proxy code can be used to build a library that can, in turn be linked to c# or vb.net client applications that need to call the “TestService” methods.)

Creating a Web Service with ASP.NET

Build a c# library from the c# proxy code by cutting and pasting it into an editor. Save the file as “TestService.cs”.

Build the TestService as an library (dll) assembly by invoking the following command:

mcs TestService.cs /target:library -r System.Web.Services.dll

Now you can use the “TestService.dll” assembly with other c# or vb.net applications to call the TestService.asmx web service. (Try it!)

Web Service Client Solution

Create a file named TestClient.cs containing the following:

using System;

class TestClient {

static void Main() {

TestService s = new TestService();

Console.WriteLine(“Web Service says: “ + s.Echo(“Hola”));

Console.WriteLine(“Web Service said 10 + 2 = “ + s.Add(10, 2));

Console.WriteLine(“Web Service said 10 - 2 = “ + s.Subtract(10, 2));

Console.WriteLine(“Web Service said 10 * 2 = “ + s.Multiply(10, 2));

Console.WriteLine(“Web Service said 10 / 2 = “ + s.Divide(10, 2));

}

}

Build Command:

mcs TestClient.cs –r TestService.dll

Run:

mono TestClient.exe

Coding Challenge

Create an ASP.NET web service that provides the ability to add and list entries in the 'test' database (created on slide 53).

- Write a C# console application that invokes the web services to add entries to the database and retrieve entries from the database.

(First student to complete this challenge will receive a prize!)

Challenge:

Background.

The GNOME project goal was to bring missing technologies to Unix and make it competitive in the current market place for desktop applications. We also realized early on that language independence was important, and that is why GNOME APIs were coded using a standard that allowed the APIs to be easily wrapped for other languages. Our APIs are available to most programming languages on Unix (Perl, Python, Scheme, C++, Objective-C, Ada).

The Common Language Infrastructure platform.

Microsoft has created a new development platform. The highlights of this new development platform are:

A runtime environment that provides garbage collection, threading and a virtual machine specification (The Virtual Execution System, VES)

A comprehensive class library.

A new language, C#. Very similar to Java, C# allows programmers to use all the features available on the .NET runtime.

A language specification that compilers can follow if they want to generate classes and code that can interoperate with other programming languages (The Common Language Specification: CLS)

The Common Language Infrastructure platform is similar to the goals we had in GNOME of giving language independence to programmers. It is more mature, documented, larger in scope, and has a consistent design.

Any API that is written using a CLS provider language can be used by any language that is a CLS consumer. Compilers generate code in a format called Common Intermediate Language (CIL) which is an intermediate representation of a compiled program and is easy to compile to native code or compiled using Just-in-Time (JIT) engines. The restrictions placed by the runtime on the CIL byte codes ensures that it is possible to do a good job at optimizing the code in a JIT compiler.

There is not really a lot of innovation in this platform: we have seen all of these concepts before, and we are all familiar with how these things work.

What makes the Common Language Infrastructure development platform interesting is that it is a good mix of technologies that have been nicely integrated.

The .NET development platform is essentially a new foundation for program development that gives Microsoft a room to grow for the coming years.

Why use GNOME components?

GNOME is an umbrella project that consists of infrastructural components (GUI toolkit, XML libraries, CORBA implementation, printing architecture, imaging system), a desktop environment, and productivity applications.

The GNOME infrastructural components can be used to quickly implement various pieces of the class libraries without reinventing the wheel, and since all those components are licensed under the terms of the GNU LGPL it is a perfect fit.

Libart will be used to implement the Drawing.2D API; Gtk+ and the GNOME libraries will be used to implement the WinForms API and of course Glib and libxml will be used in various places

What makes up Mono?

There are various pieces that make up Mono today:

A C# compiler.

The Virtual Execution System: that has the Just-in-Time compiler, garbage collector, loader, threading engine. A byte code interpreter is provided for quickly porting Mono to new systems and debugging the JIT purposes, but it is not intended to be the ideal execution environment.

An implemenation of the .NET class libraries: Remoting, Reflection, Reflection.Emit, Xml, Xpath, Xslt, Xml Serialization, Web Services support.

Cross platform class libraries for data access: Postgress, MySQL, DB2, TDS, Sybase, Oracle, ODBC and Gnome's GDA.

Unix class libraries: Mono.Posix

Gnome-specific class libraries: The Gtk# family.

A code pre-compiler to generate native code ahead of time.

Gtk# a toolkit to develop GNOME applications on Unix and Windows.

An implementation of the Remoting infrastructure in .NET

Other work-in-progress components:

A VB.NET compiler and JScript compilers are in the works.

Web services on the server side.

We are planning to include Remoting.CORBA as part of Mono standard distribution.

Why use GNOME components?

GNOME is an umbrella project that consists of infrastructural components (GUI toolkit, XML libraries, CORBA implementation, printing architecture, imaging system), a desktop environment, and productivity applications.

The GNOME infrastructural components can be used to quickly implement various pieces of the class libraries without reinventing the wheel, and since all those components are licensed under the terms of the GNU LGPL it is a perfect fit.

Libart will be used to implement the Drawing.2D API; Gtk+ and the GNOME libraries will be used to implement the WinForms API and of course Glib and libxml will be used in various places

The Mono runtime

The Mono runtime engine is considered feature complete.

It implements a Just-in-Time compiler engine for the CIL virtual machine, the class loader, the garbage collector, threading system and metadata

access libraries.

We currently have two runtimes:

mono: Our Just-in-Time and Ahead-of-Time code generator for maximum performance.

mint: The Mono interpreter. This is an easy-to-port runtime engine.

We are using the Boehm conservative garbage collector.

The Mono runtime can be used as a stand-alone process, or it can be embedded into applications (see the documentation in mono/samples/embed

for more details).

Embedding the Mono runtime allows applications to be extended in C# while reusing all of the existing C and C++ code.

Paolo Molaro did a presentation on the current JIT engine and the new JIT engine. You can find his slides here

The Mono runtime

The Mono runtime engine is considered feature complete.

It implements a Just-in-Time compiler engine for the CIL virtual machine, the class loader, the garbage collector, threading system and metadata

access libraries.

We currently have two runtimes:

mono: Our Just-in-Time and Ahead-of-Time code generator for maximum performance.

mint: The Mono interpreter. This is an easy-to-port runtime engine.

We are using the Boehm conservative garbage collector.

The Mono runtime can be used as a stand-alone process, or it can be embedded into applications (see the documentation in mono/samples/embed

for more details).

Embedding the Mono runtime allows applications to be extended in C# while reusing all of the existing C and C++ code.

Paolo Molaro did a presentation on the current JIT engine and the new JIT engine. You can find his slides here

The Class Library

The Class Library should be compatible with Microsoft's .NET implementation.

Please see the Class Status page for a status of who is working on which classes. We will write as much code as possible in C#.

We may need to interface with code written in C to gain access to the functionality of libraries like libart, Gtk+, and libc.

Gtk#

Gtk# (Gtk sharp) is a set of C# language bindings for the Gtk+ toolkit and other libraries that are part of the GNOME platform .

GTK# On Linux

Where to get distributions of GTK# for Linux:

RPMs

Debs

Buidling on Linux:

Get GTK# source from Gtk# Project.

run ./autogen.sh --prefix=my_mono_installation_prefix

make

make install

ASP.NET

ASP.NET support is divided in two pieces:

Web Forms (Web Applications infrastructure).

Web Services (the SOAP-based rpc system).

Both are functional at this point, and applications like "IBuySpy" run with Mono.

ASP.NET works either embedded into our XSP server test server or the mod_mono Apache module.

We are now working on bug fixing and adding missing features after making the whole pipeline compatible with MS.

Tim started work on the Web Services. After that, Lluis is in charge and has been working hard on them as part of our SourceGear contract. Web services are now supported and there are some samples in the XSP set of tests.

Hosting

ASP.NET provides a hosting interface. Today we ship support for two different hosting mechanisms:

XSP: A light-weight C# web server.

mod_mono: An apache module that can host the Mono runtime and the ASP.NET runtime

XSP

XSP is a simple web server written in C# that can be used to run your ASP.NET applications. The code is available from our download page or from the Anonymous CVS repository (module name: xsp)/. This is where initial development of the .aspx/.ascx/.asax compiler to C# took place. That compiler is now integrated in System.Web classes mostly under System.Web.Compilation namespace. We added a new web server that works with mono and MS runtime and is being used to debug our classes. It resides in xsp/server.

A couple of classes of this new server can be reused/extended to make an apache module/cgi using mono (MonoWorkerRequest and MonoApplicationHost). This server also uses a couple of plugins distributed with Mono to support gzip HTTP transfers.

There is also a set of .aspx pages to test the server along with a few user controls under xsp/test.

You can check it out from CVS and run 'make install' to test it.

mod_mono

This Apache module is available from our download page. The cvs module name is mod_mono. It works with both 1.3 and 2.0 versions of the apache server.

It allows apache to serve ASP.NET pages.

Work is underway to improve it.

ADO.NET

Data Access in Mono

Today, our goal is to be compatible with .NET 1.0 and .NET 1.1. We also would like to extend data access beyond what is included with .NET 1.0 and .NET 1.1, such as, including access to more databases, such as, PostgreSQL and MySQL, but also provide classes that help in creating data source-agnostic code, such as, Mono.Data.ProviderFactory.

In the future, we would like to be compatible with .NET 1.2. This would include features like:

ObjectSpaces

provide support for hosting Mono languages (C-Sharp, MonoBASIC, etc...) within a DBMS engine, such as, MySQL or PostgreSQL.

implement .net 1.2 classes, such as, those found in System.Data.ProviderBase

other stuff which can be brought up on the mono-list

MCS: The Ximian C# compiler

The Mono C# compiler is considered feature complete at this point and relatively mature. MCS is able to compile itself and many more C# programs (there is a test suite included that you can use). It is routinely used to compile Mono, roughly half a million lines of C# code.

mbas: Mono's Basic.NET Compiler.

MBAS is a CIL compiler for the Visual Basic language, an extended version of VisualBasic.NET. It's based on the MCS compiler and still in heavy development, though many language features are already supported.

2004-03-02T01:51:26