SEARCH

How-To Geek

Run ASP.NET applications on Ubuntu (for developers)

The ASP.NET development environment on Ubuntu Linux is called XSP. This is a simple webserver written in C# that can be used for either ASP.NET 1.0 or 2.0 applications. You can install both environments side by side if need be.

Requirements:

Mono development environment.

ASP.NET 1.0

sudo apt-get install mono-xsp mono-xsp-base

sudo apt-get install asp.net-examples

This will install the development environment along with some sample applications. To run the sample applications, you will launch the XSP process and point it at the samples. You’d simply modify the path to run an application that you’ve created.

> xsp –root /usr/share/asp.net-demos/

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

ASP.NET 2.0

sudo apt-get install mono-xsp2 mono-xsp2-base

sudo apt-get install asp.net2-examples

This will install the development environment along with some sample applications. To run the sample applications, you will launch the XSP process and point it at the samples. You’d simply modify the path to run an application that you’ve created.

> xsp2 –root /usr/share/asp.net2-demos/

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

At this point, you’d want to navigate in your browser to http://localhost:8080/ and you should see a page similar to this:

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 09/17/06

Comments (11)

  1. Ben

    I think it’s –root instead of -root and I came across a problem when I point my browser to localhost:8080:
    Error Message: HTTP 404. File not found /usr/share/asp.net2-demos/index2.aspx

  2. steve

    didn’t have time to do much investigating but:

    sudo cp /usr/share/asp.net2-demos/index.aspx /usr/share/asp.net2-demos/index2.aspx

    then try again was enough to get a look at it.

  3. JC DENTON

    Thanks for the post.

    Your post distinguishes between xsp and xsp2. This is not described in the man pages…

    Now I would like to use the ajax framework with mono/asp

  4. Adam

    I get an error :
    invoke-rc.d: unknown initscript, /etc/init.d/mono-xsp2 not found.
    dpkg: error processing /var/cache/apt/archives/mono-xsp2_1.1.17.1-2_all.deb (–unpack):
    subprocess pre-installation script returned error exit status 100
    Errors were encountered while processing:
    /var/cache/apt/archives/mono-xsp2_1.1.17.1-2_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    When running: sudo apt-get install mono-xsp2 mono-xsp2-base

    Anybody have any clues.

    Thanks.

  5. Adam

    Hello all,
    I was just going to post an update.

    Here is a link that will explain the problem I previously posted.

    https://bugs.launchpad.net/ubuntu/+source/xsp/+bug/99798

    I just moved the the mono-xsp file mentioned in the post, to a different folder; installed 2.0. Then moved mono-xsp back to it original location.

    Hope this helps.

    Adam

  6. Deepak

    Is it possible to run .net (Windows) applications like Extreme Movie Manager like this?

  7. Josh

    Can you run mono as a daemon? I’d like to have the ability to use ubuntu as my webserver and still use some ASP.NET, but if I have to log in and run this everytime to have my pages work, it’s useless.

  8. cherry

    i had to run:

    xsp2 –root /usr/share/asp.net2-demos/

    insted of :

    xsp2 –root /usr/share/asp.net2-demos/

  9. Loic Duros

    cherry:

    I had to run xsp2 –root /usr/share/asp.net2-demos/ too (two hyphens before root)

  10. maitreyi

    sudo apt-get install mono-xsp mono-xsp-base

    sudo apt-get install asp.net-examples

    after running these 2 commands i dont know what has to done exactly

  11. Ben

    One important point… change to /usr/share/asp.net-demos/ directory before starting the server.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!