ASP.NET MVC 1 and 2 on Mono 2.4 with Fluent NHibernate - asp.net-mvc

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:
ASP.NET MVC on mono without any persistence model support, and using nhaml as the view engine
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/

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!!

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

Related

upgrading asp.net mvc apps

Upgrading MVC apps done with VS 2010 has been the biggest issue for me. I have an application that I use to run various websites and I maintain and develop this application separetely then upgrade the sites based on it. A lot of things might change during development of a new version - new Views, new Controllers, stuff added into JS files, updated stylesheets etc.
I've searched around the web but nothing useful came up besides this Haack's article but no source code is available.
I also tried making a Nuget package for the entire MVC app and while this works, it doesn't package up the resource files (an issue within Nuget itself) and my apps rely on those so until this is fixed I cannot use this method.
I checked how others do it and this pretty much summarizes Umbraco's way and it's the same painful way of a dozen of steps like I do it now.
Do you have any good advice on it?
You don't specify the target OS, but I create native packages, i.e. .deb for Ubuntu servers.
However this still means you need to specify all files, manage configuration, upgrade database schemes. But if you test this on a CI server it becomes more reliable, and you can do it iteratively. This is all part of good deployment practice. I can recommend the Continuous Delivery book.

does nhibernate.burrow work with mvc.net and dot net 4.0 framework

I am thinking of using nHibernate.Burrow in my mvc.net application. However there are several troubling things that I have read and I am hoping to get them sorted out before I embark on the project:
Are there any issues with running .Burrow with mvc.net?
Are there issues with running .Burrow with the 4.0 framework?
How tightly coupled is .Burrow with the nHibernate? I have read several things indicating that I have to use the same version of nHibernate as was used to create the .Burrow binaries.
Any other thoughts that people have?
Yes, you should use Burrow with appropriate NHibernate version. If you want to use it with another one you can try to put assemblyRedirect in web.config file.
And I wouldn't try to use Burrow with MVC. Yes, it has Session magement and some other usefull featrures, but they are tied to ASP.NET Web Forms.
As a base framework for mvc applications I would suggest Sharp Architecture. It has all required binaries and all versions are latest.

Any experiences using SharpDevelop to build an ASP.NET MVC app?

I've always used VS for .NET development, but am just wondering about the alternatives around now. I'm especially interested in use for ASP.NET MVC development. I'm not bothered about any of the visual design aspects of vs, but of course love intellisense and the debugging features.
So, for anyone who has tried SharpDevelop when doing ASP.NET MVC:
How did you get on?
What are the main disadvantages and pain points?
Thanks
By the looks of it, SharpDevelop won't have any problems compiling the project and editing the source...you just won't get any tooling support. From what I've read, that includes aspx files.
Having said that, there does seem to be some movement around an ASP.NET plug-in editor for SharpDevelop here.
Source: http://community.sharpdevelop.net/forums/t/7872.aspx
As an aside, it might to nice to update this question with your experiences if you go down that route... (:
I have used SharpDevelop to create an ASP.Net WebForms project - didn't have too many issues with it. The lack of a visual designer is certainly annoying, but it forces you to think about the source directly, which is a good thing...
I haven't done anything with MVC yet - though from the sounds of things the only thing that's stopping SD at the moment is the tooling. The core developers might have no plans for that, but it's an open source project, so there's nothing stopping an independent effort.
I've gone a very limited amount of work (bug investigation) with the SD code - it seems to me that once you understand their classes it's not bad code... Their failing as a project has been (as it is with most open source efforts) that everyone wants to code, so the documentation gets ignored. No-one likes writing documentation, but clear documentation might have led to far greater participation...
It's a great project, but their decision to ignore the web is madness.
As Kieron said, you'll be able to compile and you'll lack tooling. Unfortunately, #Develop's forum says that they don't plan to directly support it:
ASP.NET support is not planned for SharpDevelop.
The lack of tooling and knowing that it's not coming anytime soon would be the major pain point for me.

Solution for web designer using an OSX to develop an ASP.NET MVC project?

The project is developed using ASP.NET MVC framework and heavily relies on .NET 3.5.
What would be the best solution to allow a web designer, who is using OSX, to develop the site's UI? Basically he would just need to edit the aspx, css and js files, but also run the web application locally.
I've thought of some possibilites:
Install parallels/vmware/bootcamp and set up everything as you would for windows. Bad: it would be slow, OSX user doesn't like working in windows
Set up Mono and run the webapp on that. Use whatever tool you want for editing the front end files. Bad: does mono support MVC framework, .NET 3.5 and database connections? Unfamiliar platform, so possibly a lot of work setting it up, if it even will work.
Run the site on a separate server, and edit the front end files via network drive. Bad: our development server is so slow that seeing the changes takes too long...
Do you have other ideas or comments for these options?
Thanks!
You could try using a virtual machine. VirtualBox is a free one and is quite simple to setup. The only downside is that you need your own copy of Windows...
What you really need to do is have your web designer mock up the pages in static HTML, CSS, and JavaScript first (in their environment of preference.) Once that's done, adapting the markup to the ASP.NET project should be easily doable by yourself or the designer on a Windows machine (or virtual machine, your preference).
The MVC framework is part of Mono. Ares Technica has an article about the MVC framework and running it on Mono.
While it seems that some people were able to hack the framework to work on Mono back in March and April of this year, Microsoft has since released the MVCframework as open source and it is now fully supported by Mono as of the 2.4.2 release.
Here is a link to the most recent Mono releases along with Virtual Machine images that already been pre-configured to give you the best development experience.
Good luck with your project and hope this helps some.

Shaml with NHibernate Contrib

Shaml looks awesome for project kick-start.
Would be great if it could be configured to also include NHibernate Search and other Contrib projects. Any plans for this?
Although the 1.x versions of NHibernate were very stable under mono, the recent version 2.0.1 and 2.1beta have many issues (like the lazy loading not working). I hope the 2.1 final will be much more stable under mono, and all the other projects (I'm mostly interested in NHibernate.Linq) will work without major problems too. Until that point I try to minimize the dependencies on external stuff and/or send patches to the maintnainers of the different projects (like DNOA). If you happen to succesfully integrate NHibernate 2.1 and/or NHibernate Search feel free to fork the github project.

Resources