0

将 PusherClient 0.5.1 与 WebSocket4Net 0.15.2 一起使用。

经过一堆 NuGet 更新后,当我尝试 Connect() 时,我现有的代码现在会中断。如下:

    var pusher = new Pusher("de504dc5763aeef9ff52");
    pusher.Connect();

错误是:

System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Void WebSocket4Net.WebSocket..ctor(System.String, System.String, System.Collections.Generic.List1<System.Collections.Generic.KeyValuePair2<System.String,System.String>>, System.Collections.Generic.List1<System.Collections.Generic.KeyValuePair2<System.String,System.String>>, System.String, System.String, WebSocket4Net.WebSocketVersion, System.Net.EndPoint)'.
Source=PusherClient
StackTrace:
at PusherClient.Connection.Connect()
at PusherClient.Pusher.Connect()
4

2 回答 2

0

这是由于与最新版本的 websocket4net 不兼容。开发人员正在更新 Pusher 以解决此问题。 https://github.com/pusher/pusher-http-dotnet/issues/44

于 2018-03-16T13:11:49.047 回答
0

这通常是当您在项目中的某处有旧的 .dll 文件时会发生这种情况,在这种情况下,Websocket4Net特别是包。

如果您使用 VS 和/或删除包含 Websocket4Net 的“packages/”中的文件夹(它将在下一次构建时自动恢复),请尝试“Clean Solution”。

于 2018-02-08T23:07:47.027 回答