4

I added all SignalR component but I still have got some errors about dll recognition.

The type or namespace name 'Hub' could not be found (are you missing a using directive or an assembly reference?)

I added following libraries on NuGet;

  • Microsoft.ASpNet.SignalR
  • Microsoft.ASpNet.SignalR.Client
  • Microsoft.ASpNet.SignalR.Core
  • Microsoft.ASpNet.SignalR.JS
  • Microsoft.ASpNet.SignalR.OWin
  • Microsoft.ASpNet.SignalR.SystemWeb
  • Microsoft.Owin
  • Microsoft.Owin.Host.SystemWeb
  • Microsoft.Owin.Security

I think, I don't need most of them.

namespace GenelProject
{
    [HubName("gsChat")]
    public class ChatHub : Hub

Why Visual Studio doesn't recognize SignalR hub when I want to use it ?

Erdogan
  • 952
  • 12
  • 26

2 Answers2

3

You only need the Microsoft.AspNet.SignalR.Core package. And make sure you have the namespace Microsoft.AspNet.SignalR imported with a using statement in your file.

Saravana
  • 37,852
  • 18
  • 100
  • 108
  • I removed all packages and just added SignalR.Core then Rebuild is fine but when I run the application throw an exception as Microsoft.Owin.Security : 0x80131040 – Erdogan May 12 '16 at 08:57
  • I solved 0x80131040 error following solution; http://stackoverflow.com/a/22061918/1327316 – Erdogan May 12 '16 at 09:27
1

please right click on your project and select manage Nuget Packages then in Installed tab find Microsoft.ASPnet.signalR press uninstall. then try installing it again.

Mohammad Olfatmiri
  • 1,605
  • 5
  • 31
  • 57
  • I already removed all packages and reinstall but it couldn't solve my problem. Even so yes you may be right, I read somewhere in this forum, sometimes that way may be a solution. – Erdogan May 12 '16 at 10:55