Skip to content

autofac/Autofac.SignalR

Repository files navigation

Autofac.SignalR

ASP.NET classic SignalR integration for Autofac.

Build status

Please file issues and pull requests for this package in this repository rather than in the Autofac core repo.

If you're working with ASP.NET Core, you want Autofac.Extensions.DependencyInjection, not this package.

Quick Start

To get Autofac integrated with SignalR you need to reference the SignalR integration NuGet package, register your hubs, and set the dependency resolver.

protected void Application_Start()
{
  var builder = new ContainerBuilder();

  // Register your SignalR hubs.
  builder.RegisterHubs(Assembly.GetExecutingAssembly());

  // Set the dependency resolver to be Autofac.
  var container = builder.Build();
  GlobalHost.DependencyResolver = new AutofacDependencyResolver(container);
}

Check out the Autofac SignalR integration documentation for more information.

Get Help

Need help with Autofac? We have a documentation site as well as API documentation. We're ready to answer your questions on Stack Overflow or check out the discussion forum.