title: Request is not available in this context Error
body: <p>On a shared hosting where I uploaded my Application files, I get the aforementioned exception each time I log on to the website. Below is the exception with it's stack trace.</p>
  
  <hr>
  
  <blockquote>
    <p>Request is not available in this context</p>
    
    <p>Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.Web.HttpException: Request is not available
    in this context</p>
    
    <p>Source Error: </p>
    
    <p>An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.</p>
    
    <p>Stack Trace: </p>
    
    <p>[HttpException (0x80004005): Request is not available in this context]
    System.Web.HttpContext.get_Request() +8891008<br>
    Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetConfiguration(String
    configFilePath) +115<br>
    Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.PopulateSection(ModulesConfigurationSection
    section, String rootDirectory) +186<br>
    Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetModuleConfigurationSection()
    +79    Microsoft.Practices.CompositeWeb.Services.WebModuleEnumerator.EnumerateModules()
    +173    Microsoft.Practices.CompositeWeb.WebClientApplication.LoadModules()
    +216    Microsoft.Practices.CompositeWeb.WebClientApplication.Application_Start(Object
    sender, EventArgs e) +149</p>
    
    <p>[HttpException (0x80004005): Request is not available in this context]
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext
    context, HttpApplication app) +2761334<br>
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
    appContext, HttpContext context, MethodInfo[] handlers) +128<br>
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
    MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188<br>
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
    appContext, HttpContext context) +295<br>
    System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr
    appContext, HttpContext context) +56<br>
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
    appContext) +231</p>
    
    <p>[HttpException (0x80004005): Request is not available in this context]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8994307 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
    wr, HttpContext context) +333</p>
  </blockquote>
  
  <p>I can see it's from <code>Application_Start</code> event from Global.asax. But I don't see what may be causing the exception. Below is the code in the event;</p>
  
  <pre><code>    void Application_Start(object sender, EventArgs e) 
      {
          XmlDocument xml = new XmlDocument();
          xml.Load(HostingEnvironment.MapPath(@"\Config\tasks.config"));
          XmlNodeList nodes = xml.SelectNodes("Tasks/Task");
  
          this._scheduler = new TaskScheduler(nodes);
          this._scheduler.StartTasks();
      }
  </code></pre>
  
  <p>What could I be possibly doing wrong here?</p>