Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Guys,

I am running Visual Studio 2010, i installed Nuget and added SignalR to my project.

The main problem here is that i cant find SignalR Hub Class in Add New Item dialog, is it that i have to connect to internet and add it to all websites from Nuget always..

Help please..
Posted

There is no need to install that package every time.
Download compatible version of SignalR, copy following dll files from package folder which is already installed in your project and copy these files in bin folder of a project.

Microsoft.AspNet.SignalR.Core.dll

Microsoft.AspNet.SignalR.Owin.dll

Microsoft.AspNet.SignalR.SystemWeb.dll

Microsoft.Owin.Host.SystemWeb.dll

Microsoft.Web.Infrastructre.dll

Newtonsoft.Json.dll

Owin.dll

then Add Refrences to these dll files.

Add a new class file called LetsHub.cs.

In that file i wrote the following code,
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR.Hubs;
using Microsoft.AspNet.SignalR;

namespace demo.Hubs
{
[HubName("chatHub")]
public class LetsChat : Hub
{
public void SendMsg(string Message)
{
Clients.All.addMessage(Message);
}
}
}
 
Share this answer
 
you can find SignalR Hub Class in Visual studio 2013 only
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900