在IIS中不工作MVC异步儿童行动 [英] MVC async child actions not working in IIS

查看:85
本文介绍了在IIS中不工作MVC异步儿童行动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新的MVC5网站与具有它所包含的子行动的召唤视图。这孩子操作使用异步的关键字,因为它做了一些工作DB。

I have a new MVC5 website with a view that has a call to a child action contained within it. This child action uses the "async" keyword as it does some DB work.

这在当地工作使用IIS防爆preSS没有问题的,但是如果我在Windows Server 2008 R2的运行运行这个IIS 7.5中,我得到了以下令人费解的错误:

This works locally no problem using IIS Express, however if I run this on a windows server 2008 R2 running IIS 7.5 I get the following obscure error:

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.

我已阅读,MVC是不能完全异步能力,但为什么会在IIS防爆preSS这项工作,如果是这样的问题?过了好一会儿要认识到这是与异步操作的问题,因为所有其他视图在两种环境下工作也没有问题。

I have read that MVC is not fully async capable, but why would this work in IIS Express if that was the issue? It took a while to realise that this was a problem with the "async" action as all other views worked no problem in both environments.

推荐答案

儿童行动目前都没有能够运行的异步。这将在MVC 6更改,但当然,所以将孩子行动的整体概念,也为它的价值。

Child actions currently are not capable of being run asynchronously. That will change in MVC 6, but of course, so will the whole concept of child actions, too, for what it's worth.

在此期间,任何你在孩子做动作必须同步完成的。

In the meantime, anything you do in a child action must be done synchronously.

这篇关于在IIS中不工作MVC异步儿童行动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆