using SignalR with autofac

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi

I am trying to create a chat page using SignalR but I don't know much about Autofac.  Can anyone help me how to setup SignalR dependency with Autofac?  I am using SignalR 1.0 -pre version.

Thanks much
William
11 years ago
maybe this can helps!
https://github.com/pszmyd/SignalR.Autofac
http://www.szmyd.com.pl/blog/wiring-signalr-with-autofac#.UKpd14c8B8E
11 years ago
Thanks for the links.  I looked at those before and am trying to use it but it's kind of hard trying to learn how nopCommerce guys are using the Autofac.  I can't directly use that that code.  I am trying to modify the code but I am having a hard time getting it to work with nopCommerce infrastructure.

Thanks
11 years ago
did u look at Nop.Web.Framework.DependencyRegistrar.cs ?
11 years ago
Yeah, I did and I am.  I am not sure how I can integrate it there.  Any suggestion?

Thanks again
11 years ago
I added builder.RegisterType<ChatService>().As<IChatService>().InstancePerHttpRequest();

I guess I should use InstancePerLifetimeScope instead?

I know I need to do something in global class but code below is from that link and this doesn't seem to work in my global page

//need to change this code
var container = builder.Build();
var resolver = new AutofacDependencyResolver(container);
AspNetHost.SetResolver(resolver);
11 years ago
do u have access to http://localhost:/signalr/hubs   ?
11 years ago
yeah, I can do all that except post the data to database.  I just can't get the IOC to work using Autofac.
11 years ago
I think you better use Microsoft.AspNet.SignalR...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.