views:

2100

answers:

3

Hi!

I'd like to create an application using ASP.NET MVC, that should run under mono 2.4 (compiling will be done on a Windows box). Has anyone getting luck with this? Here is what I've already tried:

  1. ASP.NET MVC on mono without any persistence model support, and using nhaml as the view engine
  2. S#aml architecture, which is a quite good framework imho, but it depends too much on stuff, that are not working good under mono (like windsor)

The first part worked fine, I didn't encounter any major problems. But I couldn't get the second part working. It seems it's dependency on Castle.Windsor breaks the whole mono support (but there might be other parts too).

Therefore I decided to create an alternative framework, that borrows some of the ideas of s#arp-architecture, but designed to be working under mono (and if I'm able to do this I'll release it for the community of course). The controller and view part is working fine (not much magic here though, they have been always working), but I have some questions before I start job on the persistence part:

  • What NHibernate versions are working under mono? I've heard 1.2 is working fine. Does 2.0.1/2.1 beta work under mono?
  • Does Fluent.NHibernate and NHibernate.Linq work under mono? (for the latter it seems it needs some dependcies that aren't avaialable in mono)
  • Are there any good alternatives for persistence support to NHibernate under mono?

Alternative questions:

  • Are there any frameworks that have mono+persistence+asp.net mvc support already or am I the first one to think about this?
  • If you have already done this: what are your opinions on stability/usability?

Thanks for the answers

EDIT: Updated the framework to support ASP.NET MVC 2: http://shaml.sztupy.hu/

A: 

Sorry I don't have any answers but I too am very interested in using mono, asp.net mvc, nhibernate

Graham P
You're supposed to add an answer, your addition would've fit better as a comment to the original question..
Carl Hörberg
Comments can't be added with a reoutation of 1
SztupY
If you're interested in the question, vote it up...
Roger Lipscombe
+9  A: 

I am using mono 2.4 to run a asp.net mvc app + windows service. Compatibility is very good. There are some bugs and differences than with windows but once you learn what they are it gets easier (there can be pain at the start!)

I am using NHibernate (2.1) FluentNhibernate, StructureMap, NBehave, Moq and open id lib and they all just seem to work as expected.

As for stability, since I have ironed out the major bugs in my code I haven't had any problems.

Usability, well it is a completely different platform so you need to come to it with an open mind and be prepared to leave behind the windows way.. the good news is that once you do that things get easier. Apache is a lot nicer than IIS and configuring and managing a linux box is just easier than windows.

I am pretty glad I choose mono.. sorry this is starting to sound like a PR drive - but I am just really happy with it!!

Derek Ekins
Did you had any problems with AntiForgeryTokens? For me the helper method throws a NullPointerException while serializing something in the System.Web.UI namespace...Btw. currently this is the only bug I'm encountering.
SztupY
Can't say I have tried them!I don't take a lot of user input so haven't looked into using them at all.
Derek Ekins
Did you try to use NHibernate.Linq (new in 2.1) within your application? It seems to require System.Data.Serviecs and System.Data.Entity which is not in Mono. I can't seem to make it run. I'm building my MVC site on Visual Studio and deploying to Apache.
mbp
+3  A: 

Okay. I started on a new project that incorporates the best from S#arp Architecture with stuff, that work on mono. Instead of T4Toolkit it uses a ruby script to do the generation job, just as with rails or merb.

To use install the shaml gem from github:

gem install shaml

Then create a new application:

shaml generate app AppName

And create resources:

shaml generate resource NewRes "name:string;date:DateTime"

S#aml Architecture project homepage: http://shaml.sztupy.hu/

GitHub project: http://github.com/sztupy/shaml/tree/master

SztupY
Just tested: it compiles under mono
SztupY