title: Autofac scope lifetime issue
body: <p>I have ASP.NET MVC application where I registered a component with an <code>InstancePerHttpRequest</code> scope.</p>
  
  <pre><code>builder.RegisterType&lt;Adapter&gt;().As&lt;IAdapter&gt;().InstancePerHttpRequest();
  </code></pre>
  
  <p>then I have an async piece of code where I'm resolving the Adapter component.</p>
  
  <p>The following code is simplified</p>
  
  <pre><code>Task&lt;HttpResponseMessage&gt; t = Request.Content.ReadAsMultipartAsync(provider).ContinueWith(t =&gt;
  
        // IHandleCommand&lt;T&gt; takes an IAdapter as contructor argument
        var h = DependencyResolver.Current.GetServices&lt;IHandleCommand&lt;T&gt;&gt;();
  );
  </code></pre>
  
  <p>The code above is throwing an exception: <code>The request lifetime scope cannot be created because the HttpContext is not available.</code></p>
  
  <p>So I did some research on the subject and found this answer
  <a href="https://stackoverflow.com/a/8663021/1003222">https://stackoverflow.com/a/8663021/1003222</a></p>
  
  <p>Then I adjusted the resolving code to this</p>
  
  <pre><code> using (var c= AutofacDependencyResolver.Current.ApplicationContainer.BeginLifetimeScope(x =&gt; x.RegisterType&lt;DataAccessAdapter&gt;().As&lt;IDataAccessAdapter&gt;).InstancePerLifetimeScope()))
   {
         var h = DependencyResolver.Current.GetServices&lt;IHandleCommand&lt;T&gt;&gt;();
   }
  </code></pre>
  
  <p>But the exception stayed the same. <code>The request lifetime scope cannot be created because the HttpContext is not available.</code></p>
  
  <p>Am I missing something ?</p>