C# dotnet Http Pusher seems broken when updated via NuGet

358 views Asked by At

Using PusherClient 0.5.1 with WebSocket4Net 0.15.2.

After a pile of NuGet updates, my existing code now breaks when I try to Connect(). As below:

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

Error is:

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()
2

There are 2 answers

1
FreezyLemon On

This is usually what happens when you have old .dll files somewhere in your project, in this case the Websocket4Net package specifically.

Try "Clean Solution" if you're using VS and/or deleting the folder inside "packages/" containing Websocket4Net (it'll be restored automatically on the next build).

0
Sean On

This was due to an incompatibility with the latest version of websocket4net. The developers are updating Pusher to fix the issue. https://github.com/pusher/pusher-http-dotnet/issues/44