Umbraco on Mono

by grendel 23. July 2009 12:34

This week I've spent some time trying to fix bugs preventing Umbraco from running unmodified on Mono. Unfortunately, some modifications to Umbraco source code (diff here) were necessary due to the inherent Windows-centric coding in parts of the CMS. The diff above takes care of just one part of the cross-platform issues in Umbraco, namely it replaces hard-coded use of the \ directory separator character with the, correct, Path.DirectorySeparatorChar. For some reason MONO_IOMAP mechanism didn't take care of the problem, hence the workaround (I'm going to fix the IOMAP issue after I'm back from vacation mid-August). The other cross-platform issue is (very common in Windows .NET applications) inconsistent use of file naming case which MONO_IOMAP is dealing with nicely.

Making Umbraco run on Mono required some fixes to our ASP.NET parser (revisions 138474, 138520, 138521 and 138592 in trunk, for those interested. Backported to both 2.4 and 2.4.2 branches) as well as making AppDomain not reload when Umbraco writes to the Web.config file. All of the fixes willbe part of the upcoming 2.4.2.3 release. There are however some issues not fixed yet, but with workarounds:

Web.config modifications during setup
Generally it works fine - application isn't restarted, data is written to the config file, but for some reason Umbraco installer caches data from before database access credentials change. So if, for instance, you were presented with MS-SQL setup box and switched to MySQL, the connection and/or database creation will fail trying to use MS-SQL code. This is a bug in Mono which I'm going to investigate in August. Workaround for this issue is to stop the app after selecting the new database provider and credentials and just restart the installation process - everything will work fine from that moment on.
VistaDB not working
VistaDB comes without source, so I wasn't able to investigate what the issue was. The symptom is that when trying to connect to or populate VistaDB database you will get either a ThreadAbortException, a TypeInitializationException or a JIT error about invalid IL in the VistaDB assembly. This is likely a runtime issue - to be investigated. You can use either SQL Server or MySQL providers instead (I used MySQL for testing).
Intermittent exceptions
Sometimes visiting certain pages in the admin interface causes an exception to be thrown (usually NullReferenceException) but I never succeeded in reproducing the exception(s) by repeating the actions. To be investigated.
TinyDLL.dll is a native library
Since it is native, our compiler cannot figure out what to do with it and throws an exception. Simply remove the dll from there - it shouldn't be there anyway.
So, this is the current status of Umbraco on Mono - please play with it and report any bugs you might find, giving exact directions how to reproduce the issue. I will take a look at them once I'm back from vacations.

Since not everybody might want to or know how to compile and set up Umbraco from sources, I have precompiled the package with the diff applied and repackaged the 4.0.2.1 distribution with the bin/ assemblies replaced by their "Mono versions" (note that the ONLY difference in the assemblies is that the patched ones are cross-platform). Here are the download locations:

Tags:

Mono | ASP.NET

Comments (8) -

Hartvig
Hartvig
7/27/2009 7:31:52 AM #

Fantastic news - would you be interested in getting commit access to the Umbraco branch?

We've been trying to get Umbraco working on mono for ages without success so this just made my day! Does XSLT parsing (and Umbraco XSLT extensions) work as well?

Reply

dfgdfg
dfgdfg
8/10/2009 4:58:44 AM #

sdfsdf

Reply

Funny Picture
Funny Picture
8/17/2009 6:33:50 AM #

thanks for this usefull informations..
finally i find something that i want to know..
this article is very usefull..

Reply

webmaster
webmaster
8/19/2009 10:51:04 AM #

There is obviously a lot to know about this.  I think you made some good points in Future also.

Reply

maurya
maurya
9/21/2009 7:44:31 AM #

I tried to install umbraco on Debian machine + mono 2.4.3

not success full , is it possible to have instructions /steps to be followed to run MVC?

Thanks

Reply

grendel
grendel
9/21/2009 7:50:20 AM #

As written in the post above, the port isn't fully finished yet. Unfortunately, I haven't had time to go back to Umbraco yet.

As for MVC, there are no special instructions - it works just like in .NET

Reply

maurya
maurya
9/21/2009 7:46:31 AM #

its

Mono JIT compiler version 2.4.2.3 (Debian 2.4.2.3+dfsg-2)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none

Reply

beth paparone
beth paparone
3/16/2011 9:46:37 PM #

I have always used umbraco and our office loves it

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

RecentComments

Comment RSS