Skip to main content

Posts

Showing posts from July, 2021

AutoFac for SignalR using ASP.NET Core version 5.0

Putting this here, so it might help someone else in the future! Couldn't find an example for version 5 of ASP.NET Core - the number of breaking changes in ASP.NET Core is incredible, and a big negative for the framework when looking to integrate 3rd party services such as logging & IOC. Steps: 1. Add nuGet packages: Autofac Autofac.Extensions.DependencyInjection 2. Update Program.cs file to add AutoFac Factory: Highlighted the import part in Red : 3. Update Startup.cs file to add AutoFac container configuration: Highlighted the import part in  Red : IRegisterService & IRegisterHub are interfaces I created for easy registration with AutoFac.