In the Application Pool Advanced Settings - The Identity User password had expired. Also, changed the Enable 32- bit Applications to True.
This fixed my issue
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Hopefully someone can point me in the right direction to resolve this problem, I have setup another SignalR hub in my blazor Server application and am getting the following failure when tryign to access the page that the SignalR hub is supposed to be connected to for auto updates.
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 RevIntra.UI.Base.Pages.Revroof.RevbendOrderListViewPage.OnInitializedAsync() in D:\Shared\Source\Repos\Revroof\RevIntra_BP\RevIntra\Shared\RevIntra.UI.Base\Pages\Revroof\RevbendOrderListViewPage.cs:line 75
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
My code kicks off form the follwing..
protected override async Task OnInitializedAsync()
{
userInfo = await ((IdentityAuthenticationStateProvider)authStateProvider).GetUserViewModel();
_hubConnection = new HubConnectionBuilder()
.WithUrl(NavigationManager.ToAbsoluteUri("/revbendorderhub"))
.WithAutomaticReconnect()
.Build();
_hubConnection.On<AXOrderHeader>("ReceiveMessage", (orderHeader) =>
{
int index = this._messages.FindIndex(x => x.OrderDid == orderHeader.OrderDid);
if (index >= 0)
{
if (orderHeader.OpenOrder)
{
this._messages[index] = orderHeader;
}
else
{
this._messages.RemoveAt(index);
}
}
else if (orderHeader.OpenOrder)
{
this._messages.Add(orderHeader);
}
StateHasChanged();
});
await _hubConnection.StartAsync(); **<--- Call to intialise hub**
loadCompleted = true;
}
The module that it is failing in is the inbuilt HubConnection class at this point:
private async Task StartAsyncInner(CancellationToken cancellationToken = default)
{
await _state.WaitConnectionLockAsync(token: cancellationToken).ConfigureAwait(false);
try
{
if (!_state.TryChangeState(HubConnectionState.Disconnected, HubConnectionState.Connecting))
{
throw new InvalidOperationException($"The {nameof(HubConnection)} cannot be started if it is not in the {nameof(HubConnectionState.Disconnected)} state.");
}
// The StopCts is canceled at the start of StopAsync should be reset every time the connection finishes stopping.
// If this token is currently canceled, it means that StartAsync was called while StopAsync was still running.
if (_state.StopCts.Token.IsCancellationRequested)
{
throw new InvalidOperationException($"The {nameof(HubConnection)} cannot be started while {nameof(StopAsync)} is running.");
}
using (CancellationTokenUtils.CreateLinkedToken(cancellationToken, _state.StopCts.Token, out var linkedToken))
{
await StartAsyncCore(linkedToken).ConfigureAwait(false); <-- **here is where it is failing**
}
_state.ChangeState(HubConnectionState.Connecting, HubConnectionState.Connected);
}
catch
{
if (_state.TryChangeState(HubConnectionState.Connecting, HubConnectionState.Disconnected))
{
_state.StopCts = new CancellationTokenSource();
}
throw;
}
finally
{
_state.ReleaseConnectionLock();
}
}
Regards
Peter
In the Application Pool Advanced Settings - The Identity User password had expired. Also, changed the Enable 32- bit Applications to True.
This fixed my issue
did you create the hub in program.cs?
app.MapHub<MyHub>("/revbendorderhub");
I'm getting the same issue:
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 ETR.Blazor.Client.Services.HubConnectionService.HubConnectionService.StartConnectionAsync()
I believe I'm configured OK, because it runs ok on my local dev box.
This only occurs when I publish to the test servers..
I have the same problem only when i hosted on IIS in default website but when i hosted as speared application work without error but real-time not working