Timeout when using Async

If I just fire one of the asynchronous events, everything runs exactly as it should. However, when I add to all 3 of my events, I get (from what I collect) a timeout from my syntax. Here is a complete stack trace that hopefully helps.


System.Web.HttpUnhandledException (0x80004005): The exception of type "System.Web.HttpUnhandledException" is fixed. ---> System.NullReferenceException: the reference to the object is not installed in the instance of the object.
   in System.Web.UI.Page.d__554.MoveNext ()
   in System.Web.UI.Page.HandleError (exception e)
   in System.Web.UI.Page.d__554.MoveNext ()
--- End of stack trace from previous the place where the exception --- were selected
   in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task objectives) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (task task)
   in System.Web.TaskAsyncHelper.EndTask (IAsyncResult ar)
   in System.Web.UI.Page.AsyncPageEndProcessRequest (result of IAsyncResult)
   in ASP.pages_AsyncTest1_aspx.EndProcessRequest (IAsyncResult ar) in c: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET files \ vs \ 14a1541c \ 96dbdee3 \ App_Web_AsyncTest1.aspx.f9b0821b.q.qc.0 row 0
   in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute ()
   in System.Web.HttpApplication.ExecuteStep (IExecutionStep step, logic and complete synchronous)
exceptions Type: System.Web.HttpUnhandledException
Message: Fixed an exception of type "System.Web.HttpUnhandledException".
StackTrace:
   in System.Web.UI.Page.HandleError (exception e)
   in System.Web.UI.Page.d__554.MoveNext ()
--- The end of the stack trace from the previous place where the exception was thrown ---
   in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task Tasks)
   in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)
   in System.Web.TaskAsyncHelper.EndTask (IAsyncResult ar)
   in System.Web.UI.Page.AsyncPageEndProcessRequest (result of IAsyncResult)
   in ASP.pages_AsyncTest1_aspx.EndProcessRequest (IAsyncResult ar) in c: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET files \ vs \ 14a1541c \ 96dbdee3 \ App_Web_Asyncccbest1.pctbtasp. 0.cs: line 0
   in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute ()
   on System.Web.HttpApplication.ExecuteStep (step IExecutionStep, logical and completed synchronously)

#, :

namespace CEDS
{
  public partial class BBLL : System.Web.UI.UserControl
  {
      private DataSet DS = new DataSet();
      private DataSet DS1 = new DataSet();
      private DataSet DS2 = new DataSet();

      protected void Page_Load(object sender, EventArgs e)
      {
        if (!IsPostBack)
        {
            Page.RegisterAsyncTask(new PageAsyncTask(RunSQLUSP)); 
        }
      }
      public async System.Threading.Tasks.Task RunSQLUSP()
      {
          var t1 = GetDataForDropDown1();
          var t2 = GetDataForDropDown2();
          var t3 = GetDataForDropDown3();
          //This line is hit then error is thrown 
          await System.Threading.Tasks.Task.WhenAll(t1, t2, t3);

          //Bind Data to grids/dropdowns

        }
    }
}

async System.Threading.Tasks.Task<DataSet> GetDataForDropDown1()
{   
  DS = GetDataForDropDown1();
  return DS;            
}
async System.Threading.Tasks.Task<DataSet> GetDataForDropDown2()
{   
  DS2 = GetDataForDropDown2();
  return DS2;           
}
async System.Threading.Tasks.Task<DataSet> GetDataForDropDown3()
{   
  DS = GetDataForDropDown3();
  return DS;          
}
+4
1

answer.

AsyncTimeout aspx. , AsyncTimeout, , , . .

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BBLL.aspx.cs" Inherits="Sample03.Default" Async="true" AsyncTimeout="600000" %> //10 mins
+5

All Articles