我們正在Beta HyperV環境中獲取MVC AsyncController的TimeoutException。在本地調試時一切正常,但是當我們部署到預生產環境時,出現此錯誤:HyperV環境中AsyncController的TimeoutException
[TimeoutException:操作超時。] System.Web.Mvc.Async.WrappedAsyncResult`1。結束()+129 System.Web.Mvc.Async。 <> c_ DisplayClass39.b _38(IAsyncResult asyncResult)+23 System.Web.Mvc.Async。 <> c_ DisplayClass33.b _2d()+125 System.Web.Mvc.Async。 <> c_ DisplayClass49.b _43()+452 System.Web.Mvc.Async。 <> c_ DisplayClass49.b _43()+452 System.Web.Mvc.Async。 <> c_ DisplayClass49.b _43()+452 System.Web.Mvc.Async。 <> c_ DisplayClass31.b _30(IAsyncResult asyncResult)+15 System.Web.Mvc.Async。 <> c_ DisplayClass24.b _1a()+31 System.Web.Mvc.Async。 <> c_ DisplayClass1f.b _1c(IAsyncResult asyncResult)+230 System.Web.Mvc。 <> c_ DisplayClass17.b _12(IAsyncResult asyncResult)+28 System.Web.Mvc.Async。 <> c_ DisplayClass4.b _3(IAsyncResult ar)+20 System.Web.Mvc.AsyncController.EndExecuteCore(IAsyncResult asyncResult)+53 System.Web.Mvc.Async。 <> c_ DisplayClass4.b _3(IAsyncResult ar)+20 System.Web.Mvc。 <> c_ DisplayClass8.b _3(IAsyncResult asyncResult)+42 System.Web.Mvc.Async。 <> C_ DisplayClass4.b _3(IAsyncResult的AR)+20 System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult的AR)+136
[OutputCache(Duration = 0, NoStore = true, VaryByParam = "")]
public void IndexAsync()
{
using (var context = Repository.CreateContext().CreateUnitOfWork())
{
user = context.Users.Single(u => u.Username == User.Identity.Name);
AsyncManager.OutstandingOperations.Increment();
ThreadPool.QueueUserWorkItem(o => {
var sync = myService.DoThingsAsync(user);
sync.AsyncWaitHandle.WaitOne();
AsyncManager.OutstandingOperations.Decrement();
});
}
}
/// IndexCompleted is never called
public ActionResult IndexCompleted(string property)
{
using (var context = Repository.CreateContext().CreateUnitOfWork())
{
var user = context.Users.Single(u => u.Username == User.Identity.Name);
var model = new MyViewModel
{
ModelProperty = user.Property
};
return View("Index", model);
}
}
會是什麼這個錯誤的一些可能的原因是什麼?
謝謝,這是有道理的。 – josefresno 2010-10-26 16:59:50