Orchard begins to work under Mono

by grendel 3. February 2011 10:32
After 4 days of work, the first Orchard screen rendered:

This is just a start as it's only the setup screen, but it's a major step forward and a sign that Mono supports MVC3/Razor well enough to run a pretty complex application Orchard is. Make no mistake - the simplicity of the screen is misleading. Behind the scenes we have a whole lot of dynamic objects created using DLR, lots of components built, assemblies loaded, files parsed and code generated. Note also that NO changes were needed to Orchard code in order to make this happen.

I have modifed the setup screen code a bit to show that it indeed runs on Mono :)

The next step is set up SQL and see what breaks next :). It's a good start though!

To test this yourself you will need:

  • Mono from the master branch (all the necessary fixes are ported to the mono-2-10 as well but I haven't really tested it with 2.10 so I can't certify it works there)
  • MonoDevelop from its master branch (xbuild will currently not work).
After the build is done make sure to remove the Orchard.Web/bin/Microsoft.Web.Infrastructure.dll assembly as Mono provides its own version. And remember that Orchard is a .NET 4.0 application - you need to use the following command to run it:
MONO_IOMAP=all xsp4

Tags:

Mono | MVC | MVC3 | Orchard | Razor

Mono and ASP.NET MVC v3

by grendel 17. January 2011 09:23
Microsoft has recently released the next version of the ASP.NET MVC stack and many of you have been asking whether Mono supports it. The answer is complicated since this MVC release is much bigger and includes more components than the previous ones. Unfortunately not all of those components have been released as open source software (although they come with the right to redistribute the assemblies) and therefore MVC integration with the Mono sources and build system makes no point at the moment. The highlight of the release is the new Razor template engine which is among the source-less components, so the Mono build of MVC would have to be done without support for Razor, which would probably take away all the fun from using it for many people. Having said that, I have managed to get to compile with current Mono from master after stubbing out several assemblies (read below for the list) and disabling Razor. The code lives in my local git branch and is not going to hit the Mono repository just yet. The reason for this is that we have decided to first make sure that MVC binaries from Microsoft work fine with Mono and only then set out to implement the non-open source assemblies it relies upon. I committed several changes (commits: c372ab7, 0582257, 1d5e3d4, d18d086, aa2ad86, cd511ea and 3e62637) which made it possible to run an MVC v3 application generated from the default VisualStudio template using several assemblies distributed by Microsoft. To get the application working you need to put in your bin/ folder the following dlls:
  • System.Web.Mvc.dll
  • System.Web.Razor.dll
  • System.Web.WebPages.Deployment.dll
  • System.Web.WebPages.dll
  • System.Web.WebPages.Razor.dll
All of the above assemblies, with the exception of the Mvc one, come without sources and will be at some point implemented in Mono. Also note that the Microsoft.Web.Infrastructure assembly added with the above commits is mostly a collection of stubs so you might (and will) come across the NotImplementedException from time to time. So, with the above changes you should be able to give MVC v3 on Mono a spin - if you come across any issues with running your app on Mono, do file a bug report attaching your application (or, if it is too big/private/secret/etc, a small test case which triggers the issue) to help us iron out all the rough edges.

Update: Gonzalo got Razor working under Mono - please report all the issues you have with your Razor applications under Mono! Congrats, Gonzalo :)

Tags: ,

Mono | ASP.NET | MVC | MVC3

RecentComments

Comment RSS