title: autofac with signalr no parameterless constructor defined for this object
body: <p>I'm using autofac on my current Asp project and everything works fine until i decided to use dependancy injection in a signalR Hub</p>
  
  <p>here's my startup class </p>
  
  <pre><code>public partial class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          ConfigureAuth(app);
          var builder = new ContainerBuilder();
          builder.RegisterControllers(Assembly.GetExecutingAssembly());
          builder.RegisterType&lt;UnitOfWork&gt;().As&lt;IUnitOfWork&gt;().InstancePerLifetimeScope();
          builder.RegisterType&lt;DbFactory&gt;().As&lt;IDbFactory&gt;().InstancePerLifetimeScope();
          //builder.RegisterHubs(Assembly.GetExecutingAssembly());
          builder.RegisterType&lt;DiscussionHub&gt;();
          // Repositories
          builder.RegisterAssemblyTypes(typeof(LanguagesRepository).Assembly)
              .Where(t =&gt; t.Name.EndsWith("Repository"))
              .AsImplementedInterfaces().InstancePerRequest();
          // Services
          builder.RegisterAssemblyTypes(typeof(LanguageService).Assembly)
             .Where(t =&gt; t.Name.EndsWith("Service"))
             .AsImplementedInterfaces().InstancePerRequest();
  
          IContainer container = builder.Build();
          DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
          var config = new HubConfiguration
          {
              Resolver = new Autofac.Integration.SignalR.AutofacDependencyResolver(container)
          };
          app.UseAutofacMiddleware(container);
          AutoMapperConfiguration.Configure();
          app.MapSignalR("/signalr",config);
      }
  }
  </code></pre>
  
  <p>and here's my Hub </p>
  
  <pre><code>public class DiscussionHub : Hub
  {
      private readonly IDiscussionService _discussionService;
      public DiscussionHub(IDiscussionService discussionService)
      {
          _discussionService = discussionService;
      }}
  </code></pre>
  
  <p>the error is that i'm getting no parameterless constructor on my Hub? any suggestion ?!</p>