javascript - 'Hub' is an ambiguous reference -
i'm using these libraries in application:
using signalrdemo.hubs; using microsoft.aspnet.signalr.hubs; using system.threading.tasks; using system.web.script.serialization;
now have implement iconnect, idisconnect
interface. so, added using signalr.hubs;
, added function in chathub class:
public class chathub : hub, iconnected, idisconnect { public task connect() { //call joined method on connected clients return clients.joined(context.connectionid); } }
client side code:
chathub.joined = function (connectionid) { $('#connections').append('<li>connect: ' + connectionid + '</li>'); }
but, when build solution shows error.
'hub' ambiguous reference between 'microsoft.aspnet.signalr.hub' , 'signalr.hubs.hub'
you have 2 different assemblies of signalr in project. latest version uses microsoft.aspnet.signalr
namespace. check assemblies , remove previous version.
otherwise need tell compiler namespace want use.
public class chathub : microsoft.aspnet.signalr.hub
edit:
halter74 pointed out iconnected
, idisconnect
interfaces have been removed. onconnected
, ondisconnected
, onreconnected
virtual methods can found on hub class.
Comments
Post a Comment