Support

Kom i kontakt med vår kundtjänst, lär dig allt via vår SDK eller ladda ner den senaste uppdateringen.

Setting up API for iPhone-app, getblogs throws error

2011-02-08 17:57:23 Rickard Lövgren

Hi.

I'm trying to set up a site in order to manage it with the new iPhone-app. I have followed the steps to the letter and all the calls are functioning except the getblogs-call.

When trying to call /api/custom/getblogs?username=administrator&password=[removed] the following exception is thrown:

[MissingMethodException: Method not found: 'System.Collections.Generic.IList`1<System.String> Mindroute.Core.Search.ContentQuery.get_ContentTypes()'.]
   Controllers.CustomController.GetBlogs(String username, String password, String languageid) +0
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +141
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +251
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +31
   System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +534
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +312
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +694
   System.Web.Mvc.Controller.ExecuteCore() +136
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +51
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +15
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +77
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +39
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +454
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263

 

The site is running Lemoon 4.3.2.0.

All replies

  • 2011-02-08 21:45:50 Magnus Krona

    Is this an upgraded lemoon 4.2.x site or a new lemoon 4.3.2 site? There seems to be an issue with the:

    --------------------
    ContentQuery query = new ContentQuery();

    query.ContentTypes.Add(typeof(Blog).FullName); //This is where the error seems to occur...
    ---------------

    Could you please try to add this code to a standard template or control on the web site and see if it throws an error? Try the code:

    ---------------------

    ContentQuery query = new ContentQuery();

    query.ContentTypes.Add(typeof(Blog).FullName);

    query.OrderBy.Add(new SortItem(ContentColumn.Title, SortDirection.Ascending));

    //query.PageSize = 10;

    PagedList<Mindroute.Core.Model.Content> result = contentservice.Search(query); 

    ----------------

    I think you are still using the 4.2.x assemblies since there was a change in the ContentQuery.ContentTypes.Add() method in 4.3.

  • 2011-02-16 14:24:00 Rickard Lövgren

    Thank you Magnus!

    You were absolutely right! I doubled checked the actual assemblies used in the application and they were indeed 4.2.x, replacing them solved the problem. Thanks for your swift reply!

    After fixing the problem I sought to find the underlying problem to why the "wrong" assemblies were being used in the first place. After some digging I found it:

    In 4.2.x the Visual Studio templates were located at ...\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\lemoon421-vstemplate.zip

    In 4.3.x i looks like this has changed to instead be located at ...\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\Web\lemoon-vstemplate.zip

    The major difference here is when I choose to create a new project in VS. With 4.2.x I found the "Lemoon Web Application"-project directly under the filter "Visual C#". After installing the 4.3.x-templates (in a new location) the project is found under "Visual C#->Web"-filter. As such the templates wasn't overwritten as in earlier versions.

    Unaware of this change I chose the old version template.

    I have now removed them to avoid future confusion.

    Thanks again!