【发布时间】:2018-04-20 02:35:04
【问题描述】:
我有一个在 AspNetCore 2.1.0-preview2-final 上运行的 signalR 服务器,地址为 https://localhost:44384/chathub。我的 Web 客户端和 dotnetcore 控制台应用程序成功连接到服务器,但 dotnet4 控制台应用程序失败。
SignalR 服务器 Startup.cs\Configure:
app.UseSignalR(routes =>
{
routes.MapHub<ChatHub>("/chathub");
});
在同一 signalR 服务器中运行的 Web 客户端:成功
const connection = new signalR.HubConnection(
"/chathub",
{
logger: signalR.LogLevel.Information
});
dotnetcore 控制台应用程序(Microsoft.AspNetCore.SignalR.Client 1.0.0-preview2-final):成功
_connection = new HubConnectionBuilder()
.WithUrl("https://localhost:44384/chathub")
.WithConsoleLogger()
.Build();
dotnet4 控制台应用程序(Microsoft.AspNet.SignalR.Client 2.2.3.0):失败
hubConnection = new HubConnection("https://localhost:44384/chathub");
hubProxy = hubConnection.CreateHubProxy("ChatHub");
await hubConnection.Start();
例外是:
StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent,...
有什么想法吗?
【问题讨论】:
标签: asp.net-core signalr