{"id":4818,"date":"2010-10-15T10:24:29","date_gmt":"2010-10-15T10:24:29","guid":{"rendered":"http:\/\/www.hbyconsultancy.com\/?p=4818"},"modified":"2010-10-15T10:24:29","modified_gmt":"2010-10-15T10:24:29","slug":"install-asp-net-3-5-environment-for-ubuntu-maverick-10-10","status":"publish","type":"post","link":"https:\/\/hbyconsultancy.com\/2010\/10\/install-asp-net-3-5-environment-for-ubuntu-maverick-10-10.html","title":{"rendered":"Install ASP.NET 3.5 Environment for Ubuntu Maverick 10.10"},"content":{"rendered":"

If you are just curious, or looking for a way to test or develop .NET web applications under Linux, you should look at the Mono Project<\/a>. Mono is an open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET based on the ECMA standards for C# and the Common Language Runtime.<\/p>\n

Cross platform is definitely one of its best features. Mono runs on Linux, Microsoft Windows, Mac OS X, BSD, and Sun Solaris, Nintendo Wii, Sony PlayStation 3, Apple iPhone. It also runs on x86, x86-64, IA64, PowerPC, SPARC (32), ARM, Alpha, s390, s390x (32 and 64 bits) and more. Developing your application with Mono allows you to run on nearly any computer in existence.<\/p>\n

I won\u2019t be able to try all computer in existence, but here is a quick guide to get ASP.NET 3.5 running under apache2 and ubuntu 10.10. In addition I\u2019ll install MonoDevelop IDE, to be able to explore better Mono features : Database, debugger, Unit test, Code completion, GUI \u2026 etc.<\/p>\n

\"monodevelop-mainwindow\"<\/p>\n

First we need to install the necessary packages :<\/p>\n

$ sudo apt-get install monodevelop mono-devel monodevelop-database mono-debugger mono-xsp2 libapache2-mod-mono mono-apache-server2 apache2<\/code><\/p>\n

The Apache mod_mono module is enabled after this by default, I just disable this and enable mod_mono_auto instead for Auto Configuration<\/a> :<\/p>\n

$ sudo a2dismod mod_mono
\n$ sudo a2enmod mod_mono_auto<\/code><\/p>\n

Finally we\u2019ll have to edit the mod_mono_auto.conf and add default locations :<\/p>\n

$ sudo -b gedit \/etc\/apache2\/mods-available\/mod_mono_auto.conf<\/code><\/p>\n

Then add in the end :<\/p>\n

MonoPath default \"\/usr\/lib\/mono\/3.5\"
\nMonoServerPath default \/usr\/bin\/mod-mono-server2
\nAddMonoApplications default \"\/:\/var\/www\"<\/code><\/p>\n

We restart Apache again<\/p>\n

$ sudo \/etc\/init.d\/apache2 restart<\/code><\/p>\n

Now let\u2019s create a simple hello world and give it a try :<\/p>\n

$ sudo -b gedit \/var\/www\/index.aspx<\/code><\/p>\n

And enter the code below, or any other sample<\/p>\n

<%@ Page Language=\"C#\" %>
\n<html>
\n<head>
\n<title>Sample Calendar<\/title>
\n<\/head>
\n<asp:calendar showtitle=\"true\" runat=\"server\">
\n<\/asp:calendar><\/code><\/p>\n

Then fire your fox at http:\/\/localhost\/index.aspx and you should see the default calendar, Easy ?<\/p>\n

\"Screenshot-Sample-Calendar-Mozilla-Firefox\"<\/p>\n

More info and getting started with Mono at : http:\/\/mono-project.com\/Start<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

If you are just curious, or looking for a way to test or develop .NET web applications under Linux, you should look at the Mono Project. Mono is an open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET based on the ECMA standards for C# and the Common Language […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[16,29,147,156,161,261],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts\/4818"}],"collection":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/comments?post=4818"}],"version-history":[{"count":0,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts\/4818\/revisions"}],"wp:attachment":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/media?parent=4818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/categories?post=4818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/tags?post=4818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}