We have moved to GitHub Issues
Created by Shannon Deminick 10 Jul 2014, 07:01:11 Updated by Timo 12 Nov 2015, 13:48:27
Relates to: U4-7399
Without this it basically means that any umbraco controller using this action invoker like Surface Controllers, etc... cannot execute with async code without a work around.
Otherwise you'll end up with the string output from your action:
I've added a work around while we wait till this new version is out, see the stack overflow thread above
A site I'm building on Umbraco 7.21 is still experiencing this issue, but only on any custom controller which inherits RenderMvcController (i.e. this issue affects route hijacking still).
I'm using Umbraco.Identity, which has the workaround in it already, so SurfaceControllers are able to do async actions. However any async Action on a RenderMvcController implementation still just dumps Task.ToString() to the response. Worse still if I attempt to use Task.Wait() within a synchronous action it deadlocks. I think the latter may be an ASP.NET problem rather than specifically an Umbraco problem. The net result is that I can't make any calls to an async web API from within a RenderMvcController action, not even by wait()ing for the result.
Do you have any advice on making the workaround "stick" for RenderMvcControllers? Currently I'm having my main page content load via an AJAX call to a SurfaceController action to work around this limitation, but that's not really ideal.
Hi, if you have repeatable steps please open a different issue. We are definitely setting the action invoker for RenderMvcController to RenderActionInvoker which is AsyncControllerActionInvoker which happens in the RenderControllerFactory. If you have your own factory or are using IoC in some way, potentially that might be your issue. We don't use custom action invokers for SurfaceControllers, they've always worked with any async stuff OOTB.
Calling Wait() or Result() from inside of a controller that is not async from top to bottom will generally always cause a deadlock if you are not ConfiguringAwait(false) ... in most cases. Good resources here about that:
I've been able to reproduce this issue in custom controllers and have raised it here http://issues.umbraco.org/issue/U4-7270
Assignee: Shannon Deminick
Backwards Compatible: True
Affected versions: 6.0.0, 6.1.0, 7.0.0, 7.1.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.1.1, 6.0.6, 6.0.5, 6.0.7, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.1.1, 7.1.2, 7.1.3, 6.2.1, 7.1.4
Due in version: 7.1.5, 6.2.2