Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • DennisNL 2 posts 22 karma points
    Sep 14, 2013 @ 18:59

    Asynchronous action Umbraco v6

    Dear all,

    I made an asynchronous Action:

    public async Task<ActionResult> GetMessagesUpdateAsync()
        MessagesService messagesService = new MessagesService();
        var result = await messagesService.GetMessageUpdatesAsync();
        await Task.Delay(30000);
        return Json(result, JsonRequestBehavior.AllowGet);

    But whenever I call this action, I always receive the following message:


    I tried this on a SurfaceController, an AsyncController and a regular Controller. When I run this code in a separate (not umbraco) project, the code just runs fine and returns JSON.

    Also I have tried adding the following line to my web.config on the httpRuntime node:


    As a reference I used:

    • Umbraco v6
    • ASP.NET 4.5 / MVC 4

    Am I missing something? Does anyone know if it's possible to have asynchronous actions in Umbraco?


  • Aaron Powell 1708 posts 3045 karma points c-trib
    Sep 27, 2013 @ 04:38
    Aaron Powell

    I'm experiencing this too, I've seen the problem in other frameworks that wrap around the MVC pipeline but I'm not sure what the fix is.

  • Justin Spradlin 139 posts 347 karma points
    Nov 15, 2013 @ 17:59
    Justin Spradlin

    I just wanted to jump in, I just saw this same behavior in umbraco 6.1.6. Is there any solution yet?

  • DennisNL 2 posts 22 karma points
    Nov 18, 2013 @ 10:02

    A workaround is to use an attribute to set the session readonly:

    public class LiveSessionLessSurfaceController

    Of course you can only read your session object, not modify. But it might help you anyway.

  • Chris Wallace 3 posts 23 karma points
    Feb 15, 2014 @ 16:42
    Chris Wallace

    I've been having the same problem as well in Umbraco 7 (fresh install, no upgrade), I tried applying the SessionState attribute as well to my custom Controller but no luck. Has there been any more success with this? 

  • Thiago Custodio 2 posts 22 karma points
    Feb 20, 2014 @ 20:58
    Thiago Custodio

    I'm facing the same problem running Umbraco 7.0.4. I also tried to put the     [SessionState(SessionStateBehavior.ReadOnly)] attribute, but it didn't work. Any ideas?

  • Ole Gade 5 posts 25 karma points
    Mar 28, 2014 @ 14:10
    Ole Gade

    Any news on this one? I'm facing the same problem.

  • Pete Field 4 posts 24 karma points
    Apr 11, 2014 @ 10:20
    Pete Field

    Experiencing the same thing here. 

    I asume it's because Umbraco has hooked into the ASP.Net MVC controller pipeline.

    Any workarounds?

  • Pete Field 4 posts 24 karma points
    Apr 14, 2014 @ 13:42
    Pete Field

    I have managed to get this working in v7 at least.

    More details here

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Jul 10, 2014 @ 09:07
  • Shannon Deminick 1523 posts 5255 karma points MVP
    Jul 11, 2014 @ 06:02
    Shannon Deminick

    I've added a work around to that stack overflow thread if you want to have this fixed before the next release is out.

  • Kieron McIntyre 114 posts 354 karma points
    Oct 17, 2015 @ 13:40
    Kieron McIntyre

    I've been experiencing this for quite a while in all my recent Umbraco projects (v6 and v7). They all required async operations but I kept getting the System.Threading.Tasks.Task'1[System.Web.Mvc.ActionResult] output rendered instead of the correct view.

    I figured out how to reproduce this. It seems that when a controller implements IRenderMvcController, any async Index() action will render the code output above, but if you replace this action with one of the same name of the current page's template name, the view is rendered correctly.

    I've written about it here if anyone fancies having a read.

Please Sign in or register to post replies

Write your reply to: