Thursday, August 23, 2012

Basic asp.NET dev environment in Ubuntu 12.04

I recently had to do a small example of integrating the system I am currently working on into an asp.NET application.  Not having a windows machine handy I though I would give Mono a try.  Fortunately setting up a basic dev environment was really simple.  NOTE: this is a very basic dev environment with no IDE or frameworks installed etc, it was perfect for what I needed but may not be appropriate for full blown development.

First install xsp2:

sudo apt-get install mono-xsp2


mkdir -p ~/dotnet

cd dotnet

gedit Default.aspx

Then paste in the following:

    HelloWorldLabel.Text = "Hello, world!";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:Label runat="server" id="HelloWorldLabel"></asp:Label>

now save the file and go back to the terminal and run:


*Note: this must be run in the directory where you created the file.

Now open a browser and visit:

And that's it.  This is a very basic dev environment and is probably not suitable for a full blown application but it was perfect for my needs.

No comments:

Post a Comment