title: When RegisterEventBus " No service for type Autofac.ILifetimeScope' has been registered.'
body: <p>I am configuring service bus, as per code below. When I execute this code, it accuses this error that I do not know how to configure it. Please. me the bridge from where it comes or how to arrange it</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>private void RegisterEventBus(IServiceCollection services)
          {
              var subscriptionClientName = Configuration["SubscriptionClientName"];
  
              if (Configuration.GetValue&lt;bool&gt;("AzureServiceBusEnabled"))
              {
                  services.AddSingleton&lt;IEventBus, EventBusServiceBus&gt;(sp =&gt;
                  {
                      var serviceBusPersisterConnection = sp.GetRequiredService&lt;IServiceBusPersisterConnection&gt;();
                      var iLifetimeScope = sp.GetRequiredService&lt;ILifetimeScope&gt;();
                      var logger = sp.GetRequiredService&lt;ILogger&lt;EventBusServiceBus&gt;&gt;();
                      var eventBusSubcriptionsManager = sp.GetRequiredService&lt;IEventBusSubscriptionsManager&gt;();
  
                      return new EventBusServiceBus(serviceBusPersisterConnection, logger,
                          eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope);
                  });
              }
          }</code></pre>
  </div>
  </div>
  </p>