Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIGNALR HttpContext.Current is null

Tags:

signalr

I have a question. First, excuse me for my bad english, its not my native language. Then, I have a custom ProfileProvider, i need access to HttpCurrent.Context inside. If I call to my ProfileProvider "UserXXX.GetUserProfile" from an OperationController all is OK, but if i call it from XXXHub, HttpContext.Current is null. I was using SignalR 1.0, but i like update at version 2.0. Im using Framework 4.5, visual Studio 2012, IIS Express ith Integrated Mode and Windows 7.

Can you help me please?

Thank you

like image 737
user2570599 Avatar asked Jul 11 '13 01:07

user2570599


1 Answers

In your SignalR Hub, use:

System.Web.HttpContextBase httpContext = Context.Request.GetHttpContext();

Instead of HttpContext.Current.

like image 198
Jows Avatar answered Oct 07 '22 00:10

Jows