title: ASP.NET MVC5: No scope with a Tag matching 'AutofacWebRequest' is visible from the scope
body: <p>I am encountering an error in my ASP.NET MVC 5 application using autofac v3.5.0, Autofac.Extras.CommonServiceLocator v3.2.0,  Autofac.Mvc5 v3.3.2 all with targetframework net45 :</p>
  
  <p><code>No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.</code></p>
  
  <p>when trying to convert the following Rhino-Security windsor mapping:</p>
  
  <pre><code>WindsorServiceLocator windsorServiceLocator = new WindsorServiceLocator(container);
  ServiceLocator.SetLocatorProvider(() =&gt; windsorServiceLocator);
  
      container.Register(
              Component.For&lt;IAuthorizationService&gt;()
                  .ImplementedBy&lt;AuthorizationService&gt;()
                  .Lifestyle.Is(Lifestyle.Transient),
              Component.For&lt;IAuthorizationRepository&gt;()
                  .ImplementedBy&lt;AuthorizationRepository&gt;()
                  .Lifestyle.Is(Lifestyle.Transient),
              Component.For&lt;IPermissionsBuilderService&gt;()
                  .ImplementedBy&lt;PermissionsBuilderService&gt;()
                  .Lifestyle.Is(Lifestyle.Transient),
              Component.For&lt;IPermissionsService&gt;()
                  .ImplementedBy&lt;PermissionsService&gt;()
                  .Lifestyle.Is(Lifestyle.Transient)
              );
  </code></pre>
  
  <p>to an autofac mapping. The first 4 mappings work without any issue but the last one causes the above error. I have traced the first instance of where the error occurs this line: 
  <a href="https://github.com/hibernating-rhinos/rhino-security/blob/master/Rhino.Security/Security.cs#L34">https://github.com/hibernating-rhinos/rhino-security/blob/master/Rhino.Security/Security.cs#L34</a></p>
  
  <pre><code>builder.RegisterType&lt;AuthorizationService&gt;().As&lt;IAuthorizationService&gt;().InstancePerDependency();
  builder.RegisterType&lt;AuthorizationRepository&gt;().As&lt;IAuthorizationRepository&gt;().InstancePerDependency();
  builder.RegisterType&lt;PermissionsBuilderService&gt;().As&lt;IPermissionsBuilderService&gt;().InstancePerDependency();
  builder.RegisterType&lt;PermissionsService&gt;().As&lt;IPermissionsService&gt;().InstancePerDependency();
  
  // Everything works except this
  builder.RegisterType&lt;OrganizationInformationExtractor&gt;().As&lt;IEntityInformationExtractor&lt;Organization&gt;&gt;().InstancePerDependency();
  </code></pre>