Search code examples
autofacasynccontroller

Autofac, OrchardProject and AsyncControllers


I'm working on trying to get an AsyncController to work in OrchardProject. The current version I'm using is 2.2.4.9.0.

I've had 2 people eyeball my code: http://www.pastie.org/2117952 (AsyncController) which works fine in a regular MVC3 vanilla application.

Basically, I can route to IndexCompleted, but I can't route to Index. I am going to assume i'm missing something in the Autofac configuration of the overall project.

I think the configuration is in the global.asax: http://pastie.org/2118008

What I'm looking for is some guidance on if this is the correct way to implement autofac for AsyncControllers, or if there is something/someplace else I need to implement/initialize/etc.

~Dan


Solution

  • Orchard appears to register its own IActionInvoker, called Orchard.Mvc.Filters.FilterResolvingActionInvoker.

    This class derives from ControllerActionInvoker. At a guess, in order to support async actions, it should instead derive from AsyncControllerActionInvoker.

    Hope this helps!

    Nick