This post assumes that Mono is installed on your system. The following links should help if it is not installed.

Installing Mono on Gentoo and Ubuntu 5.10
Installing Mono and XSP on Ubuntu 6.06
Installing Mono and XSP on Fedora

Installing Mono XSP on Gentoo

#emerge xsp xsp2

Installing Mono XSP on Debian/(K)Ubuntu

#sudo apt-get install xsp xsp2

Installing Complete Mono Environment(Mono, GTK#, XSP) on MS Windows

  1. Download the Mono installation file for MS Windows from the Mono website.
  2. Run the installer and follow the installation wizard.

Go to the Mono menu in the Start menu(Start->All Programs->Mono[version]) to access all the applications installed as part of Mono.

Your First ASP.NET 1.0 Application Using Mono XSP

  1. First create a directory to store the ASP.NET files and change to that directory. You can create the directory in your home directory.
    sh# mkdir aspnet && cd aspnet
  2. Create a sample ASP.NET page. Copy and paste the following code in two separate files(hello.aspx and hello.aspx.cs).
    hello.aspx

    [html]
    <%@ Page language="c#" src="hello.aspx.cs"
    Inherits="HelloApp.HelloPage" AutoEventWireup="true" %>



    Welcome to my page!

    Enter your name:

    Hello, World!



    [/html]

    hello.aspx.cs

    [csharp]
    using System;
    using System.Web.UI.WebControls;

    namespace HelloApp
    {
    public class HelloPage : System.Web.UI.Page
    {
    protected Label message;
    protected Button greet;
    protected TextBox name;

    public void OnGreetClick(Object sender, EventArgs e)
    {
    message.Text = “Hello, ” + name.Text;
    }
    }
    }
    [/csharp]

  3. From the same directory(‘aspnet’), start the XSP server:
    sh# xsp

    (you can press ENTER to terminate the XSP server process)

  4. Open a web browser, type the url http://localhost:8080/hello.aspx and press ENTER. You should see a web page with a text box and a message. Enter a name in the text box and click the “Greet” button to see the personalised greeting displayed.

On MS Windows, go to the Mono menu in the Start menu(Start->All Programs->Mono[version]), select “Mono[version] Command Prompt” menu item. Create a directory(say ‘c:\programs\aspnet’), change to that directory and copy the above two files in that directory. From the same directory, run ‘xsp’ commad to start the XSP webserver. Open a web browser and access the url http://localhost:8080/hello.aspx.

Your First ASP.NET 2.0 Application Using Mono XSP

To develop ASP.NET 2.0 applications using Mono XSP server, start ‘xsp2′ webserver instead of ‘xsp’. Create a test ASP.NET 2.0 page(say ‘hello2.aspx’) and copy it in a folder. Run the following command from the same folder:

sh# xsp2

Go to http://localhost:8080/hello2.aspx to test the ASP.NET 2.0 page.