You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have ASP.NET Core Web project, target platform: .Net Core 3.1. I have SignalR Core clients that connect to my server. I want my asp.net core server to connect to another asp.net core server to get some information. But before, I need to install Microsoft.AspNetCore.SignalR.Client package to make my server to use HubConnection. When I add this package, clients can no longer connect my asp.net core web server because of error 500. I didn't find any explanation in Internet why this happens and how to fix it.
Expected behavior
Connecting to the server hub
Actual behavior
Getting server error 500 on client side when connecting to the server hub
Log:
Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.NegotiateAsync(Uri url, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.GetNegotiationResponseAsync(Uri uri, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken)
at Halloween_Night_Matchmaking_Client.MatchmakingClient.Connect(Action onComplete) in D:\MAGGOT\Studio\Halloween Night Matchmaking Client\MatchmakingClient.cs:line 81
at Halloween_Night_Matchmaking_Client_Demo.Program.InitMatchmakingClient(Action onComplete) in D:\MAGGOT\Studio\Halloween Night Matchmaking Client Demo\Program_MatchmakingClient.cs:line 90
at System.Threading.Tasks.Task.<>c.b__139_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Steps to reproduce
Create ASP.NET Core Web project, target platform: .Net Core 3.1
Install Microsoft.AspNetCore.SignalR.Client package v.7.0.8 (<--- it breaks the things; removing this package fixes the problem, but I need this package to create HubConnection on server to connect another server)
The code I use on server side to create signalR:
public class Startup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
// Use this method to add services to the container
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<Matchmaking>();
services.AddSignalR();
}
// Use this method to configure the HTTP request pipeline
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseStatusCodePages();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<MatchHub>("/matchmaking");
});
}
}
The code I use to connect to the server on client side:
connection = new HubConnectionBuilder()
.WithUrl(host)
.Build();
The text was updated successfully, but these errors were encountered:
I have ASP.NET Core Web project, target platform: .Net Core 3.1. I have SignalR Core clients that connect to my server. I want my asp.net core server to connect to another asp.net core server to get some information. But before, I need to install Microsoft.AspNetCore.SignalR.Client package to make my server to use HubConnection. When I add this package, clients can no longer connect my asp.net core web server because of error 500. I didn't find any explanation in Internet why this happens and how to fix it.
Expected behavior
Connecting to the server hub
Actual behavior
Getting server error 500 on client side when connecting to the server hub
Log:
Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.NegotiateAsync(Uri url, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.GetNegotiationResponseAsync(Uri uri, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken)
at Halloween_Night_Matchmaking_Client.MatchmakingClient.Connect(Action onComplete) in D:\MAGGOT\Studio\Halloween Night Matchmaking Client\MatchmakingClient.cs:line 81
at Halloween_Night_Matchmaking_Client_Demo.Program.InitMatchmakingClient(Action onComplete) in D:\MAGGOT\Studio\Halloween Night Matchmaking Client Demo\Program_MatchmakingClient.cs:line 90
at System.Threading.Tasks.Task.<>c.b__139_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Steps to reproduce
The code I use on server side to create signalR:
The code I use to connect to the server on client side:
The text was updated successfully, but these errors were encountered: