Total Posts:
6
Karma:
40
Joined:
7/20/2011
Location:
United States
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
Total Posts:
69
Karma:
933
Joined:
12/5/2009
Location:
United States
maybe this can helps! https://github.com/pszmyd/SignalR.Autofac http://www.szmyd.com.pl/blog/wiring-signalr-with-autofac#.UKpd14c8B8E
Total Posts:
6
Karma:
40
Joined:
7/20/2011
Location:
United States
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
Total Posts:
69
Karma:
933
Joined:
12/5/2009
Location:
United States
did u look at Nop.Web.Framework.DependencyRegistrar.cs ?
Total Posts:
6
Karma:
40
Joined:
7/20/2011
Location:
United States
Yeah, I did and I am. I am not sure how I can integrate it there. Any suggestion? Thanks again
Total Posts:
6
Karma:
40
Joined:
7/20/2011
Location:
United States
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);
Total Posts:
69
Karma:
933
Joined:
12/5/2009
Location:
United States
do u have access to http://localhost:/signalr/hubs ?
Total Posts:
6
Karma:
40
Joined:
7/20/2011
Location:
United States
yeah, I can do all that except post the data to database. I just can't get the IOC to work using Autofac.
Total Posts:
69
Karma:
933
Joined:
12/5/2009
Location:
United States
I think you better use Microsoft.AspNet.SignalR...