23

Mono 2.10's release notes suggest support for ASP.NET MVC 3.0 and Razor using XSP.

Upon opening a newly created ASP.NET MVC 3.0 default project (created with Visual Studio 2010) in MonoDevelop 2.4.2 (Mac OS X), the following DLLs are missing:

System.Web.Entity
System.Web.Helpers
System.Web.Mvc
System.Web.WebPages

All of which I replace with DLLs obtained from my Windows installation. The project builds, but I receive the following error message when trying to debug the project:

Adding applications '/:.'...
Registering application:
    Host:          any
    Port:          any
    Virtual path:  /
    Physical path: /.../Mvc3Test/
Handling exception type TargetInvocationException
Message is Exception has been thrown by the target of an invocation.
IsTerminating is set to True
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

Prior to making these replacements, the application runs but obviously with missing reference errors. Which would suggest that something in the new DLLs is screwing up the XSP server.

What am I doing wrong? Am I being too simplistic? I'm new to Mono and MonoDevelop, but I am successfully able to create, build and debug MVC 2.0 projects with my current installation of MonoDevelop.

Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
kim3er
  • 6,306
  • 4
  • 41
  • 69
  • Look at http://twistedcode.net/blog/post/2011/01/17/Mono-and-ASPNET-MVC-v3.aspx and http://gonzalo.name/blog/archive/2011/Jan-21.html Although I heven't yet tried it. – silk Feb 20 '11 at 22:26
  • See also [Mono-aspnet-list Archives ](http://lists.ximian.com/pipermail/mono-aspnet-list/). I saw great number of discussion regarding [ASP.NET MVC 3](http://www.google.com/search?hl=en&safe=off&q=mvc+3+site%3Ahttp%3A%2F%2Flists.ximian.com%2Fpipermail%2Fmono-aspnet-list%2F) there. – abatishchev Feb 18 '11 at 17:00

2 Answers2

19

I'm elated. The new version of Mono, 2.10.1, fixed the issues with ASP.NET MVC 3.0. It is running without a hitch.

Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
kim3er
  • 6,306
  • 4
  • 41
  • 69
  • 1
    What about performance? I'm thinking about moving one of my asp.net mvc 3 web apps to Linux server (the only windows dependency is .net 4) as windows on a server is a lot of fun. How much do you lose in performance, how bad are memory leaks? – Ivan G. Aug 01 '12 at 09:31
10

Works fine, have a look at http://erikzaadi.com/2011/03/02/installscripttorunaspdotnetmvc3withrazoronnginxataopensuseserver/

The only trick is copying the correct assemblies...

If you need the solution, it's available at http://labs.erikzaadi.com/monoOnSuse/RazorOnMonoSolution.zip

Hope this helps.

[Note] You don't need openSuse to run the solution, just a mono 2.10 environment, works fine on mac as well.

Erik
  • 870
  • 7
  • 8