Mono ASP.NET MVC saga update

As many of you are probably well aware, we failed to ship the recently open-sourced Microsoft ASP.NET MVC with Mono 2.4.2. The release was soon followed by an update, 2.4.2.1, which included the source of MVC but, unfortunately, the story doesn't end here.

Sometime during MVC integration process, we discovered our C# compiler had a bug which made certain parts of MVC behave incorrectly. The bug was quickly fixed in trunk, but it was determined that backporting it to the 2.4 branches was not an option and since the issue was easily worked around, we decided to just put the modified MVC code in our repositories. Unfortunately, due to my mistake, the workaround didn't actually make it in neither 2.4.2.1 or 2.4.2.2 releases. I have just committed the 2-line fix (revisions r138087 and r138088) to the 2.4 branches and we should expect to see 2.4.2.3 released soon. My apologies for this omission to everybody who expected to see the bug fixed in 2.4.2.2.

If your MVC application throws an exception similar to this one:

System.ArgumentNullException: Argument cannot be null.
Parameter name: type
  at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x000ab] in /usr/src/tmp/mono-branch/mcs/class/System/System.ComponentModel/TypeDescriptor.cs:437 
  at System.Web.Mvc.DefaultModelBinder.BindModel (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext) [0x000ba] in /usr/src/tmp/mono-branch/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultModelBinder.cs:186 
  at System.Web.Mvc.ControllerActionInvoker.GetParameterValue (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ParameterDescriptor parameterDescriptor) [0x00090] in /usr/src/tmp/mono-branch/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs:119 
  at System.Web.Mvc.ControllerActionInvoker.GetParameterValues (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionDescriptor actionDescriptor) [0x00021] in /usr/src/tmp/mono-branch/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs:128 
  at System.Web.Mvc.ControllerActionInvoker.InvokeAction (System.Web.Mvc.ControllerContext controllerContext, System.String actionName) [0x00099] in /usr/src/tmp/mono-branch/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs:162 
then you are hit by the bug. At this point you have three choices:
  • Download the fixed binary from here, unpack it and replace the copy found in your 2.4 GAC either manually or by issuing the following command as user who has GAC folder write rights:
    gacutil -i System.Web.Mvc.dll
  • Take System.Web.Mvc sources from the Mono 2.4 (or 2.4.2) branch, compile it (with 2.4+ compiler)
  • Use System.Web.Mvc.dll from Microsoft .NET distribution - it will work just fine with Mono

ASP.NET MVC sources in the Mono 2.4 and 2.4.2 branches are identical to the upstream source except for the workaround. Trunk version of ASP.NET MVC is identical to upstream.

Comments

Jul 17 my net hubby

my net hubby

I was very interested to know this information about you, and I really liked your blog.This will be a big help to my new blog site.,

Jul 17 optik

optik

Nice to se MVC adoption and support in Mono

Andrés G. Aragoneses

This is unfortunate, but now that it happened and we cannot go back in time, can we take advantage of this situation to wait a bit more and also include the fix to this bug in the release?: https://bugzilla.novell.com/show_bug.cgi?id=505068

I haven't had time to provide more feedback for now, but tomorrow it's hackweek and I'll definitely take a look at it and provide the testcase. Sorry for the delay. Thanks for your hard work, we appreciate it.

Jul 20 grendel

grendel

As soon as you attach a test case, I'll fix the issue and backport the fix to 2.4. Don't worry about delays, we all have a lot of on our plates after all Smile

Andrés G. Aragoneses

Damn, I thought finding the testcase was going to be an easy task but it's not Frown
Anyway, not a big problem right now because iFolder's sources removed the comment as a workaround.

Andrés G. Aragoneses

Ok, I found a sub-bug which may be the root cause of the problem. Seems simple enough to fix quickly and backport, because I'm assuming 2.4.2.3 is not released yet, right? It would be awesome to have a fix in it, it would help iFolder community a lot.

Andrés G. Aragoneses

Oh, I listed the sub-bug as a dependency.

Jul 23 grendel

grendel

I saw it, thanks. It's indeed pretty easy to fix, I'll commit before today's morning MST and it's going to make it into 2.4.2.3

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading