【发布时间】:2015-04-22 12:31:16
【问题描述】:
我一直在尝试连接到本教程中创建的 Windows 服务:
http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host
问题是我可以使用它自己的客户端连接到它。但是,我尝试从控制台应用程序连接到它,但没有成功。此外,如果我在控制台应用程序中托管 SignalR Hub,我可以成功连接到它。
我得到的错误是我的客户端版本与服务器不兼容并且连接被拒绝。
这是我尝试连接的样子:
IHubProxy _hub;
string url = @"http://localhost:8080/";
var connection = new HubConnection(url);
_hub = connection.CreateHubProxy("MyHub");
_hub.On("addMessage", x => ShowMessage(x));
connection.Start().Wait();
更新:
-错误消息:
1.
Exception:Caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3." (System.InvalidOperationException)
A System.InvalidOperationException was caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3."
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[5924]
2.
Exception:Thrown: "No connection could be made because the target machine actively refused it" (System.Net.Sockets.SocketException)
A System.Net.Sockets.SocketException was thrown: "No connection could be made because the target machine actively refused it"
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[3320]
【问题讨论】:
-
欢迎!您能给我们提供有关错误消息的更多详细信息吗?
-
谢谢!我来这里已经有一段时间了,但总是不用问就能找到我的答案。我已经用消息错误更新了描述。
标签: c# asp.net windows-services signalr-hub signalr.client