views:

658

answers:

1

I am actually successfully running a production website with ASP.NET MVC under Mono in a Ubuntu LTS Linux. This server is located somewhere in the cloud and it rocks!

Today, I have tried to make it all work with ASP.NET MVC 2 Preview 2, which can be found here: ASP.NET MVC 2 Preview 2

I have downloaded the source code because I wanted to deploy the DLL by hand just like I am doing with v1. I find it simpler Linux not to rely on the GAC.

Everything seems to be working fine until I try to get JSON data in an AJAX call. Here is the information I get about the error...

[System.NotImplementedException]: The requested feature is not implemented. at System.Web.Mvc.AssociatedMetadataProvider.GetTypeDescriptor (System.Type type) [0x00000] at System.Web.Mvc.AssociatedMetadataProvider.GetMetadataForType (System.Func`1 modelAccessor, System.Type modelType) [0x00000] at System.Web.Mvc.ControllerActionInvoker.GetParameterValue (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ParameterDescriptor parameterDescriptor) [0x00000] at System.Web.Mvc.ControllerActionInvoker.GetParameterValues (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionDescriptor actionDescriptor) [0x00000] at System.Web.Mvc.ControllerActionInvoker.InvokeAction (System.Web.Mvc.ControllerContext controllerContext, System.String actionName) [0x00000]

+1  A: 

The feature your trying to use is not implemented. The fix would be to actually implement the feature your looking for.

Wait...

Are you using return type of JsonResult instead of ActionResult for your controller actions? Something is trying to populate the meta data about the model your passing to the view. I think if your returning JSON that piece of functionality, the metadata population, shouldn't happen.

jfar
Yes that's exactly what's happening... Do yo have any idea about how to fix this?This is where I think the problem is from..JsonResult result = new JsonResult();result.Data = activities .OrderByDescending(a => a.StartTime) .Select(a => new { Username = a.User.Name, a.Sport }) .ToArray();return result;
RooSoft